mirror of
https://github.com/ytdl-org/youtube-dl
synced 2025-01-24 20:30:13 +09:00
Add subtitles download for SonyLIV
This commit is contained in:
parent
a803582717
commit
922680a9dc
@ -96,6 +96,19 @@ class SonyLIVIE(InfoExtractor):
|
|||||||
episode = metadata.get('episodeTitle')
|
episode = metadata.get('episodeTitle')
|
||||||
if episode and title != episode:
|
if episode and title != episode:
|
||||||
title += ' - ' + episode
|
title += ' - ' + episode
|
||||||
|
|
||||||
|
subtitles = {}
|
||||||
|
for subtitle in (content.get('subtitle') or []):
|
||||||
|
base_url = subtitle.get('subtitleUrl')
|
||||||
|
if not base_url:
|
||||||
|
continue
|
||||||
|
lang_code = subtitle.get('subtitleLanguageName')
|
||||||
|
if not lang_code:
|
||||||
|
continue
|
||||||
|
subtitles[lang_code] = [{
|
||||||
|
'ext': 'vtt',
|
||||||
|
'url': base_url,
|
||||||
|
}]
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
@ -109,4 +122,5 @@ class SonyLIVIE(InfoExtractor):
|
|||||||
'episode': episode,
|
'episode': episode,
|
||||||
'episode_number': int_or_none(metadata.get('episodeNumber')),
|
'episode_number': int_or_none(metadata.get('episodeNumber')),
|
||||||
'release_year': int_or_none(metadata.get('year')),
|
'release_year': int_or_none(metadata.get('year')),
|
||||||
|
'subtitles': subtitles
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user