summaryrefslogtreecommitdiffhomepage
path: root/youtube_dl
diff options
context:
space:
mode:
authorSergey M․ <[email protected]>2016-01-22 22:23:21 +0600
committerSergey M․ <[email protected]>2016-01-22 22:23:21 +0600
commit220ee33f2b8a22d2fe992c26b32a046b77ce2a4a (patch)
tree32ecd05979f0fb988228bae482249beee1b2d298 /youtube_dl
parent4118cc02c1694a7fd355b75c806a69d75b3850bb (diff)
downloadyoutube-dl-220ee33f2b8a22d2fe992c26b32a046b77ce2a4a.tar.gz
youtube-dl-220ee33f2b8a22d2fe992c26b32a046b77ce2a4a.zip
[cbsnews] Simplify subtitles extraction and fix test (Closes #8295)
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/cbsnews.py33
1 files changed, 10 insertions, 23 deletions
diff --git a/youtube_dl/extractor/cbsnews.py b/youtube_dl/extractor/cbsnews.py
index 7b9dd67fd..480435e26 100644
--- a/youtube_dl/extractor/cbsnews.py
+++ b/youtube_dl/extractor/cbsnews.py
@@ -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,