mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-21 20:46:36 -05:00
[cspan] Extract subtitles
This commit is contained in:
parent
529d26c3e1
commit
672f1bd849
1 changed files with 11 additions and 0 deletions
|
@ -8,6 +8,7 @@
|
|||
unescapeHTML,
|
||||
find_xpath_attr,
|
||||
smuggle_url,
|
||||
determine_ext,
|
||||
)
|
||||
from .senateisvp import SenateISVPIE
|
||||
|
||||
|
@ -87,6 +88,10 @@ def _real_extract(self, url):
|
|||
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 @@ def _real_extract(self, url):
|
|||
'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:
|
||||
|
|
Loading…
Reference in a new issue