+ format_url = self._SMIL_BASE_URL + m.group('path')
+ formats.append({
+ 'url': format_url,
+ 'format_id': u'SMIL_' + m.group('cbr'),
+ 'vcodec': m.group('vcodec'),
+ 'acodec': m.group('acodec'),
+ 'vbr': int(m.group('vbr')),
+ 'abr': int(m.group('abr')),
+ 'ext': m.group('ext'),
+ 'width': int(m.group('width')),
+ 'height': int(m.group('height')),
+ })
+ return formats
+
+ def _real_extract(self, url):
+ mobj = re.match(self._VALID_URL, url)
+ video_id = mobj.group('id')
+
+ json_url = 'http://videoplayer.vevo.com/VideoService/AuthenticateVideo?isrc=%s' % video_id
+ info_json = self._download_webpage(json_url, video_id, u'Downloading json info')
+ video_info = json.loads(info_json)['video']
+
+ formats = self._formats_from_json(video_info)
+ try:
+ smil_url = '%s/Video/V2/VFILE/%s/%sr.smil' % (
+ self._SMIL_BASE_URL, video_id, video_id.lower())
+ smil_xml = self._download_webpage(smil_url, video_id,
+ u'Downloading SMIL info')
+ formats.extend(self._formats_from_smil(smil_xml))
+ except ExtractorError as ee:
+ if not isinstance(ee.cause, compat_HTTPError):
+ raise
+ self._downloader.report_warning(
+ u'Cannot download SMIL information, falling back to JSON ..')
+
+ timestamp_ms = int(self._search_regex(
+ r'/Date\((\d+)\)/', video_info['launchDate'], u'launch date'))
+ upload_date = datetime.datetime.fromtimestamp(timestamp_ms // 1000)