[twitter] Fix extraction (closes #8966)
authorYen Chi Hsuan <yan12125@gmail.com>
Sat, 26 Mar 2016 10:34:51 +0000 (18:34 +0800)
committerYen Chi Hsuan <yan12125@gmail.com>
Sat, 26 Mar 2016 10:34:51 +0000 (18:34 +0800)
HLS and DASH formats are no longer appeared in test cases. I keep them
for fear of triggering new errors.

youtube_dl/extractor/twitter.py

index e70b2ab3c8d564cd907e8763fd8136e1b3827ac5..602538e5cc09ab89214caff794358a5702e45be0 100644 (file)
@@ -110,10 +110,9 @@ class TwitterCardIE(TwitterBaseIE):
                     'height': int(m.group('height')),
                 })
 
-        playlist = config.get('playlist')
-        if playlist:
-            video_url = playlist[0]['source']
+        video_url = config.get('video_url') or config.get('playlist', [{}])[0].get('source')
 
+        if video_url:
             f = {
                 'url': video_url,
             }
@@ -185,7 +184,6 @@ class TwitterIE(InfoExtractor):
             'ext': 'mp4',
             'title': 'FREE THE NIPPLE - FTN supporters on Hollywood Blvd today!',
             'thumbnail': 're:^https?://.*\.jpg',
-            'duration': 12.922,
             'description': 'FREE THE NIPPLE on Twitter: "FTN supporters on Hollywood Blvd today! http://t.co/c7jHH749xJ"',
             'uploader': 'FREE THE NIPPLE',
             'uploader_id': 'freethenipple',