- mobj = re.search(r' name="flashvars" value="(.*?)"', webpage)
- if mobj is None:
- raise ExtractorError(u'Unable to extract media URL')
- vardict = compat_parse_qs(mobj.group(1))
- if 'mediaData' not in vardict:
- raise ExtractorError(u'Unable to extract media URL')
- mobj = re.search(r'"mediaURL":"(?P<mediaURL>http.*?)",(.*?)"key":"(?P<key>.*?)"', vardict['mediaData'][0])
- if mobj is None:
- raise ExtractorError(u'Unable to extract media URL')
- mediaURL = mobj.group('mediaURL').replace('\\/', '/')
- video_extension = mediaURL[-3:]
- video_url = '%s?__gda__=%s' % (mediaURL, mobj.group('key'))
-
- mobj = re.search(r'(?im)<title>(.*) - Video</title>', webpage)
- if mobj is None:
- raise ExtractorError(u'Unable to extract title')
- video_title = mobj.group(1).decode('utf-8')
-
- mobj = re.search(r'submitter=(.*?);', webpage)
- if mobj is None:
- raise ExtractorError(u'Unable to extract uploader nickname')
- video_uploader = mobj.group(1)
-
- return [{
- 'id': video_id.decode('utf-8'),
- 'url': video_url.decode('utf-8'),
- 'uploader': video_uploader.decode('utf-8'),
+ mobj = re.search(r'<video src="([^"]+)"', webpage)
+ if mobj:
+ video_url = mobj.group(1)
+ video_ext = 'mp4'
+ else:
+ mobj = re.search(r' name="flashvars" value="(.*?)"', webpage)
+ if mobj is None:
+ raise ExtractorError(u'Unable to extract media URL')
+ vardict = compat_parse_qs(mobj.group(1))
+ if 'mediaData' not in vardict:
+ raise ExtractorError(u'Unable to extract media URL')
+ mobj = re.search(r'"mediaURL":"(?P<mediaURL>http.*?)",(.*?)"key":"(?P<key>.*?)"', vardict['mediaData'][0])
+ if mobj is None:
+ raise ExtractorError(u'Unable to extract media URL')
+ mediaURL = mobj.group('mediaURL').replace('\\/', '/')
+ video_url = '%s?__gda__=%s' % (mediaURL, mobj.group('key'))
+ video_ext = determine_ext(video_url)
+
+ video_title = self._html_search_regex(r'(?im)<title>(.*) - Video</title>', webpage, u'title')
+ description = self._og_search_description(webpage)
+ video_uploader = self._html_search_regex(
+ r'submitter=(.*?);|googletag\.pubads\(\)\.setTargeting\("(?:channel|submiter)","([^"]+)"\);',
+ webpage, u'uploader nickname', fatal=False)
+
+ return {
+ '_type': 'video',
+ 'id': video_id,
+ 'url': video_url,
+ 'description': description,
+ 'uploader': video_uploader,