mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-27 03:03:01 +00:00
[pbs] Add support for subtitles (Closes #6184)
This commit is contained in:
parent
6dd94d3a79
commit
06a12933f3
1 changed files with 9 additions and 0 deletions
|
@ -224,6 +224,14 @@ def _real_extract(self, url):
|
||||||
rating_str = rating_str.rpartition('-')[2]
|
rating_str = rating_str.rpartition('-')[2]
|
||||||
age_limit = US_RATINGS.get(rating_str)
|
age_limit = US_RATINGS.get(rating_str)
|
||||||
|
|
||||||
|
subtitles = {}
|
||||||
|
closed_captions_url = info.get('closed_captions_url')
|
||||||
|
if closed_captions_url:
|
||||||
|
subtitles['en'] = [{
|
||||||
|
'ext': 'ttml',
|
||||||
|
'url': closed_captions_url,
|
||||||
|
}]
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'display_id': display_id,
|
'display_id': display_id,
|
||||||
|
@ -234,4 +242,5 @@ def _real_extract(self, url):
|
||||||
'age_limit': age_limit,
|
'age_limit': age_limit,
|
||||||
'upload_date': upload_date,
|
'upload_date': upload_date,
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
|
'subtitles': subtitles,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue