diff options
| author | remitamine <remitamine@gmail.com> | 2016-02-18 15:43:28 +0100 | 
|---|---|---|
| committer | remitamine <remitamine@gmail.com> | 2016-02-18 15:43:28 +0100 | 
| commit | 778433cb90064a3fbe21afb722c787841e85ddf4 (patch) | |
| tree | b820b23c33fda56ccb72b2a041ebb99a06854e51 | |
| parent | 411cb8f4769215ea6835895206782d8ec00a5114 (diff) | |
[cbsnews] extract subtitle url from theplatform SMIL manifest(fixes #8568)
| -rw-r--r-- | youtube_dl/extractor/cbsnews.py | 15 | 
1 files changed, 9 insertions, 6 deletions
diff --git a/youtube_dl/extractor/cbsnews.py b/youtube_dl/extractor/cbsnews.py index 8f864699f..f0de73aeb 100644 --- a/youtube_dl/extractor/cbsnews.py +++ b/youtube_dl/extractor/cbsnews.py @@ -46,6 +46,15 @@ class CBSNewsIE(ThePlatformIE):          },      ] +    def _parse_smil_subtitles(self, smil, namespace=None, subtitles_lang='en'): +        closed_caption_e = smil.find(self._xpath_ns('.//param[@name=\'ClosedCaptionURL\']', namespace)) +        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 +70,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)  | 
