diff options
author | Yen Chi Hsuan <[email protected]> | 2015-04-24 23:46:51 +0800 |
---|---|---|
committer | Yen Chi Hsuan <[email protected]> | 2015-04-25 23:18:27 +0800 |
commit | 672f1bd8497f43179dcd01f8b4831564f0b42356 (patch) | |
tree | 7429a0bc1bf09ec8938b5d5afba0b4664d82e26f /youtube_dl/extractor/cspan.py | |
parent | 529d26c3e191a3fc24b9c7618310c47929a0c11f (diff) | |
download | youtube-dl-672f1bd8497f43179dcd01f8b4831564f0b42356.tar.gz youtube-dl-672f1bd8497f43179dcd01f8b4831564f0b42356.zip |
[cspan] Extract subtitles
Diffstat (limited to 'youtube_dl/extractor/cspan.py')
-rw-r--r-- | youtube_dl/extractor/cspan.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/youtube_dl/extractor/cspan.py b/youtube_dl/extractor/cspan.py index d516b1402..fbefd37d0 100644 --- a/youtube_dl/extractor/cspan.py +++ b/youtube_dl/extractor/cspan.py @@ -8,6 +8,7 @@ from ..utils import ( unescapeHTML, find_xpath_attr, smuggle_url, + determine_ext, ) from .senateisvp import SenateISVPIE @@ -87,6 +88,10 @@ class CSpanIE(InfoExtractor): return self.url_result(surl, 'SenateISVP', video_id, title) files = data['video']['files'] + try: + capfile = data['video']['capfile']['#text'] + except KeyError: + capfile = None entries = [{ 'id': '%s_%d' % (video_id, partnum + 1), @@ -97,6 +102,12 @@ class CSpanIE(InfoExtractor): 'description': description, 'thumbnail': thumbnail, 'duration': int_or_none(f.get('length', {}).get('#text')), + 'subtitles': { + 'en': [{ + 'url': capfile, + 'ext': determine_ext(capfile, 'dfxp') + }], + } if capfile else None, } for partnum, f in enumerate(files)] if len(entries) == 1: |