diff options
author | Ashish <39122144+Ashish0804@users.noreply.github.com> | 2021-05-06 20:27:43 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-06 20:27:43 +0530 |
commit | c28cfda81ff9285589b7e3cfce8051100a67cf5a (patch) | |
tree | 4415304fd628854d2282882978d945c1a4aa0d37 | |
parent | 848887eb7afc98580acc7a01fc79ceccfc70d964 (diff) | |
download | hypervideo-pre-c28cfda81ff9285589b7e3cfce8051100a67cf5a.tar.lz hypervideo-pre-c28cfda81ff9285589b7e3cfce8051100a67cf5a.tar.xz hypervideo-pre-c28cfda81ff9285589b7e3cfce8051100a67cf5a.zip |
[SonyLiv] Fix `title` and `series` extraction (#301)
Authored by: Ashish0804
-rw-r--r-- | yt_dlp/extractor/sonyliv.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/yt_dlp/extractor/sonyliv.py b/yt_dlp/extractor/sonyliv.py index f0c17b256..ec95810e3 100644 --- a/yt_dlp/extractor/sonyliv.py +++ b/yt_dlp/extractor/sonyliv.py @@ -17,7 +17,7 @@ class SonyLIVIE(InfoExtractor): _TESTS = [{ 'url': 'https://www.sonyliv.com/shows/bachelors-delight-1700000113/achaari-cheese-toast-1000022678?watch=true', 'info_dict': { - 'title': 'Bachelors Delight - Achaari Cheese Toast', + 'title': 'Achaari Cheese Toast', 'id': '1000022678', 'ext': 'mp4', 'upload_date': '20200411', @@ -25,7 +25,7 @@ class SonyLIVIE(InfoExtractor): 'timestamp': 1586632091, 'duration': 185, 'season_number': 1, - 'episode': 'Achaari Cheese Toast', + 'series': 'Bachelors Delight', 'episode_number': 1, 'release_year': 2016, }, @@ -92,10 +92,7 @@ class SonyLIVIE(InfoExtractor): metadata = self._call_api( '1.6', 'IN/DETAIL/' + video_id, video_id)['containers'][0]['metadata'] - title = metadata['title'] - episode = metadata.get('episodeTitle') - if episode and title != episode: - title += ' - ' + episode + title = metadata['episodeTitle'] return { 'id': video_id, @@ -106,7 +103,7 @@ class SonyLIVIE(InfoExtractor): 'timestamp': int_or_none(metadata.get('creationDate'), 1000), 'duration': int_or_none(metadata.get('duration')), 'season_number': int_or_none(metadata.get('season')), - 'episode': episode, + 'series': metadata.get('title'), 'episode_number': int_or_none(metadata.get('episodeNumber')), 'release_year': int_or_none(metadata.get('year')), } |