[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 = [{ _TESTS = [{
'url': 'https://www.sonyliv.com/shows/bachelors-delight-1700000113/achaari-cheese-toast-1000022678?watch=true', 'url': 'https://www.sonyliv.com/shows/bachelors-delight-1700000113/achaari-cheese-toast-1000022678?watch=true',
'info_dict': { 'info_dict': {
'title': 'Bachelors Delight - Achaari Cheese Toast', 'title': 'Achaari Cheese Toast',
'id': '1000022678', 'id': '1000022678',
'ext': 'mp4', 'ext': 'mp4',
'upload_date': '20200411', 'upload_date': '20200411',
@ -25,7 +25,7 @@ class SonyLIVIE(InfoExtractor):
'timestamp': 1586632091, 'timestamp': 1586632091,
'duration': 185, 'duration': 185,
'season_number': 1, 'season_number': 1,
'episode': 'Achaari Cheese Toast', 'series': 'Bachelors Delight',
'episode_number': 1, 'episode_number': 1,
'release_year': 2016, 'release_year': 2016,
}, },
@ -92,10 +92,7 @@ def _real_extract(self, url):
metadata = self._call_api( metadata = self._call_api(
'1.6', 'IN/DETAIL/' + video_id, video_id)['containers'][0]['metadata'] '1.6', 'IN/DETAIL/' + video_id, video_id)['containers'][0]['metadata']
title = metadata['title'] title = metadata['episodeTitle']
episode = metadata.get('episodeTitle')
if episode and title != episode:
title += ' - ' + episode
return { return {
'id': video_id, 'id': video_id,
@ -106,7 +103,7 @@ def _real_extract(self, url):
'timestamp': int_or_none(metadata.get('creationDate'), 1000), 'timestamp': int_or_none(metadata.get('creationDate'), 1000),
'duration': int_or_none(metadata.get('duration')), 'duration': int_or_none(metadata.get('duration')),
'season_number': int_or_none(metadata.get('season')), 'season_number': int_or_none(metadata.get('season')),
'episode': episode, 'series': metadata.get('title'),
'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')),
} }