1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-11-13 04:51:22 +00:00

Add subtitles download for SonyLIV

This commit is contained in:
Aniruddh Joshi 2021-10-14 12:20:35 +05:30 committed by GitHub
parent a803582717
commit 922680a9dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -96,6 +96,19 @@ class SonyLIVIE(InfoExtractor):
episode = metadata.get('episodeTitle')
if episode and 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 {
'id': video_id,
@ -109,4 +122,5 @@ class SonyLIVIE(InfoExtractor):
'episode': episode,
'episode_number': int_or_none(metadata.get('episodeNumber')),
'release_year': int_or_none(metadata.get('year')),
'subtitles': subtitles
}