]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
[yahoo] Fix video extraction and use the new format system exclusively
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Wed, 27 Nov 2013 20:24:55 +0000 (21:24 +0100)
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Wed, 27 Nov 2013 20:24:55 +0000 (21:24 +0100)
youtube_dl/extractor/yahoo.py

index 34e6afb20fb6833ab21501785deb54cf5f0a0e24..617e3bb0641caf2452feb033be4d368b1f13b08a 100644 (file)
@@ -46,7 +46,7 @@ class YahooIE(InfoExtractor):
         video_id = mobj.group('id')
         webpage = self._download_webpage(url, video_id)
 
-        items_json = self._search_regex(r'YVIDEO_INIT_ITEMS = ({.*?});$',
+        items_json = self._search_regex(r'mediaItems: ({.*?})$',
             webpage, u'items', flags=re.MULTILINE)
         items = json.loads(items_json)
         info = items['mediaItems']['query']['results']['mediaObj'][0]
@@ -91,17 +91,13 @@ class YahooIE(InfoExtractor):
             formats.append(format_info)
         formats = sorted(formats, key=lambda f:(f['height'], f['width']))
 
-        info = {
+        return {
             'id': video_id,
             'title': meta['title'],
             'formats': formats,
             'description': clean_html(meta['description']),
             'thumbnail': meta['thumbnail'],
         }
-        # TODO: Remove when #980 has been merged
-        info.update(formats[-1])
-
-        return info
 
 
 class YahooSearchIE(SearchInfoExtractor):