[SonyLiv] Fix title and series extraction (#301)

Authored by: Ashish0804
This commit is contained in:
Ashish 2021-05-06 20:27:43 +05:30 committed by GitHub
parent 848887eb7a
commit c28cfda81f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 @@ def _real_extract(self, url):
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 @@ def _real_extract(self, url):
'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')),
}