- mobj = re.match(self._VALID_URL, url)
- video_id = mobj.group('videoid')
- url = 'http://www.' + mobj.group('url')
-
- req = compat_urllib_request.Request(url)
- req.add_header('Cookie', 'age_verified=1')
- webpage = self._download_webpage(req, video_id)
-
- video_title = self._html_search_regex(r'<h1>(.+?)<', webpage, 'title')
- video_url = compat_urllib_parse.unquote(self._html_search_regex(r'flashvars.video_url = \'([^\']+)', webpage, 'video_url'))
- path = compat_urllib_parse_urlparse(video_url).path
- extension = os.path.splitext(path)[1][1:]
- format = path.split('/')[5].split('_')[:2]
- format = "-".join(format)
-
- age_limit = self._rta_search(webpage)
-
- return {
- 'id': video_id,
- 'title': video_title,
- 'url': video_url,
- 'ext': extension,
- 'format': format,
- 'format_id': format,
- 'age_limit': age_limit,
- }
+ webpage, info = self._extract_info(url)
+
+ view_count = str_to_int(self._search_regex(
+ r'VIEWS:</span>\s*([\d,.]+)', webpage, 'view count', fatal=False))
+ like_count = int_or_none(self._search_regex(
+ r'id=["\']amountLikes["\'][^>]*>(\d+)', webpage,
+ 'like count', fatal=False))
+ dislike_count = int_or_none(self._search_regex(
+ r'id=["\']amountDislikes["\'][^>]*>(\d+)', webpage,
+ 'like count', fatal=False))
+ upload_date = unified_strdate(self._html_search_regex(
+ r'Added:</span>([^<]+)', webpage, 'upload date', fatal=False))
+
+ info.update({
+ 'view_count': view_count,
+ 'like_count': like_count,
+ 'dislike_count': dislike_count,
+ 'upload_date': upload_date,
+ 'thumbnail': self._og_search_thumbnail(webpage),
+ })
+
+ return info