]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
[cbsnews] Simplify subtitles extraction and fix test (Closes #8295)
authorSergey M․ <dstftw@gmail.com>
Fri, 22 Jan 2016 16:23:21 +0000 (22:23 +0600)
committerSergey M․ <dstftw@gmail.com>
Fri, 22 Jan 2016 16:23:21 +0000 (22:23 +0600)
youtube_dl/extractor/cbsnews.py

index 7b9dd67fd6f57275e68dddf29a35cad5b98d553b..480435e26114cbdf4be2bf177a2dbc2c8381420e 100644 (file)
@@ -35,21 +35,11 @@ class CBSNewsIE(InfoExtractor):
                 'title': 'Fort Hood shooting: Army downplays mental illness as cause of attack',
                 'thumbnail': 're:^https?://.*\.jpg$',
                 'duration': 205,
-            },
-            'params': {
-                # rtmp download
-                'skip_download': True,
-            },
-        },
-        {
-            'url': 'http://www.cbsnews.com/videos/mountain-lions-of-l-a/',
-            'info_dict': {
-                'id': 'Mountain Lions of L.A.',
-                'ext': 'flv',
-                'title': 'Fort Hood shooting: Army downplays mental illness as cause of attack',
-                'thumbnail': 're:^http?://.*\.jpg$',
-                'subtitles': 're:^http?://.*\.xml$',
-                'duration': 787,
+                'subtitles': {
+                    'en': [{
+                        'ext': 'ttml',
+                    }],
+                },
             },
             'params': {
                 # rtmp download
@@ -100,15 +90,12 @@ class CBSNewsIE(InfoExtractor):
                 fmt['ext'] = 'mp4'
             formats.append(fmt)
 
+        subtitles = {}
         if 'mpxRefId' in video_info:
-            cap_url = 'http://www.cbsnews.com/videos/captions/%s.adb_xml' % video_info['mpxRefId']
-            subtitles = {
-                'en': [{
-                    'url': cap_url,
-                    'ext': 'xml'
-                }], }
-        else:
-            subtitles = {}
+            subtitles['en'] = [{
+                'ext': 'ttml',
+                'url': 'http://www.cbsnews.com/videos/captions/%s.adb_xml' % video_info['mpxRefId'],
+            }]
 
         return {
             'id': video_id,