X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fcbsnews.py;h=7319ee1b734e6fc30e4cb681f66eb082ffb9622a;hb=2e7e561c1d9dedf1a8e5a206e1ef86cfa4599956;hp=8f864699f93675afe2ce00db21a13c4110bff46b;hpb=fd3a1f3d608857ee36b1c5b455bbdbd3dedc17b1;p=youtube-dl.git diff --git a/youtube_dl/extractor/cbsnews.py b/youtube_dl/extractor/cbsnews.py index 8f864699f..7319ee1b7 100644 --- a/youtube_dl/extractor/cbsnews.py +++ b/youtube_dl/extractor/cbsnews.py @@ -3,7 +3,10 @@ from __future__ import unicode_literals from .common import InfoExtractor from .theplatform import ThePlatformIE -from ..utils import parse_duration +from ..utils import ( + parse_duration, + find_xpath_attr, +) class CBSNewsIE(ThePlatformIE): @@ -46,6 +49,15 @@ class CBSNewsIE(ThePlatformIE): }, ] + def _parse_smil_subtitles(self, smil, namespace=None, subtitles_lang='en'): + closed_caption_e = find_xpath_attr(smil, self._xpath_ns('.//param', namespace), 'name', 'ClosedCaptionURL') + return { + 'en': [{ + 'ext': 'ttml', + 'url': closed_caption_e.attrib['value'], + }] + } if closed_caption_e is not None and closed_caption_e.attrib.get('value') else [] + def _real_extract(self, url): video_id = self._match_id(url) @@ -61,12 +73,6 @@ class CBSNewsIE(ThePlatformIE): thumbnail = item.get('mediaImage') or item.get('thumbnail') subtitles = {} - if 'mpxRefId' in video_info: - subtitles['en'] = [{ - 'ext': 'ttml', - 'url': 'http://www.cbsnews.com/videos/captions/%s.adb_xml' % video_info['mpxRefId'], - }] - formats = [] for format_id in ['RtmpMobileLow', 'RtmpMobileHigh', 'Hls', 'RtmpDesktop']: pid = item.get('media' + format_id)