diff options
author | Ashish <39122144+Ashish0804@users.noreply.github.com> | 2021-05-23 21:26:27 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-23 21:26:27 +0530 |
commit | 09d18ad07ea6311b7861eb77dcaa5a13f9d64fe1 (patch) | |
tree | c03f6035c5768b99556d408f92aca8fb2614a2a3 | |
parent | bc516a3f3c6ca2ee402e3a491ccfd1f32bf03fd3 (diff) | |
download | hypervideo-pre-09d18ad07ea6311b7861eb77dcaa5a13f9d64fe1.tar.lz hypervideo-pre-09d18ad07ea6311b7861eb77dcaa5a13f9d64fe1.tar.xz hypervideo-pre-09d18ad07ea6311b7861eb77dcaa5a13f9d64fe1.zip |
[Sonyliv] Add subtitle support (#342)
Authored by: Ashish0804
-rw-r--r-- | yt_dlp/extractor/sonyliv.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/yt_dlp/extractor/sonyliv.py b/yt_dlp/extractor/sonyliv.py index ec7b4f37f..60181f06d 100644 --- a/yt_dlp/extractor/sonyliv.py +++ b/yt_dlp/extractor/sonyliv.py @@ -100,7 +100,14 @@ class SonyLIVIE(InfoExtractor): metadata = self._call_api( '1.6', 'IN/DETAIL/' + video_id, video_id)['containers'][0]['metadata'] title = metadata['episodeTitle'] - + subtitles = {} + for sub in content.get('subtitle', []): + sub_url = sub.get('subtitleUrl') + if not sub_url: + continue + subtitles.setdefault(sub.get('subtitleLanguageName', 'ENG'), []).append({ + 'url': sub_url, + }) return { 'id': video_id, 'title': title, @@ -113,6 +120,7 @@ class SonyLIVIE(InfoExtractor): 'series': metadata.get('title'), 'episode_number': int_or_none(metadata.get('episodeNumber')), 'release_year': int_or_none(metadata.get('year')), + 'subtitles': subtitles, } |