Compare commits

..

6 Commits

Author SHA1 Message Date
Elan Ruusamäe
8a9a5de241 Add test data for a movie 2023-11-13 12:07:40 +02:00
Elan Ruusamäe
e6bc3cd389 Update test data 2023-11-13 12:03:06 +02:00
Elan Ruusamäe
eb112c9467 Add back episode_id, it's useful for absolute ordering 2023-11-13 11:58:54 +02:00
Elan Ruusamäe
c54853f320
Update yt_dlp/extractor/duoplay.py: Title changes
Co-authored-by: sepro <4618135+seproDev@users.noreply.github.com>
2023-11-13 11:56:18 +02:00
Elan Ruusamäe
de17d2ec5a
Update yt_dlp/extractor/duoplay.py: Try episode number cast
Co-authored-by: sepro <4618135+seproDev@users.noreply.github.com>
2023-11-13 11:41:56 +02:00
Elan Ruusamäe
0936b27e01
Update yt_dlp/extractor/duoplay.py: Use group() method
Co-authored-by: sepro <4618135+seproDev@users.noreply.github.com>
2023-11-13 11:37:48 +02:00

View File

@ -31,6 +31,7 @@ class DuoplayIE(InfoExtractor):
'season_number': 2,
'episode': 'Operatsioon "Öö"',
'episode_number': 12,
'episode_id': 24,
},
}, {
'note': 'Empty title',
@ -39,7 +40,7 @@ class DuoplayIE(InfoExtractor):
'info_dict': {
'id': '17_14',
'ext': 'mp4',
'title': 'Episode 14',
'title': 'Ühikarotid',
'thumbnail': r're:https://.+\.jpg(?:\?c=\d+)?$',
'description': 'md5:4719b418e058c209def41d48b601276e',
'upload_date': '20100916',
@ -48,13 +49,35 @@ class DuoplayIE(InfoExtractor):
'series_id': '17',
'season': 'Season 2',
'season_number': 2,
'episode': 'Episode 14',
'episode_number': 14,
'episode': None,
'episode_number': None,
'episode_id': 14,
},
}, {
'note': 'Movie',
'url': 'https://duoplay.ee/4325/naljamangud',
'md5': '2b0bcac4159a08b1844c2bfde06b1199',
'info_dict': {
'id': '4325',
'ext': 'mp4',
'title': 'Näljamängud',
'thumbnail': r're:https://.+\.jpg(?:\?c=\d+)?$',
'description': 'md5:fb35f5eb2ff46cdb82e4d5fbe7b49a13',
'cast': ['Jennifer Lawrence', 'Josh Hutcherson', 'Liam Hemsworth'],
'upload_date': '20231109',
'timestamp': 1699552800,
'series': 'Näljamängud',
'series_id': '4325',
'season': 'Season 1',
'season_number': 1,
'episode': 'Episode 0',
'episode_number': 0,
'episode_id': 0,
},
}]
def _real_extract(self, url):
telecast_id, episode = self._match_valid_url(url).groups()
telecast_id, episode = self._match_valid_url(url).group('id', 'ep')
video_id = join_nonempty(telecast_id, episode, delim='_')
webpage = self._download_webpage(url, video_id)
video_player = try_call(lambda: extract_attributes(
@ -66,9 +89,10 @@ class DuoplayIE(InfoExtractor):
return {
'id': video_id,
'title': episode_attr.get('title') if episode_attr.get('category') == 'movies' else (
traverse_obj(episode_attr, 'subtitle', ('episode_nr', {lambda x: f'Episode {x}' if x else None}), 'title')),
'formats': self._extract_m3u8_formats(video_player['manifest-url'], video_id, 'mp4'),
**traverse_obj(episode_attr, {
'title': (None, ('subtitle', ('episode_id', {lambda x: f'Episode {x}'}))),
'description': 'synopsis',
'thumbnail': ('images', 'original'),
'timestamp': ('airtime', {lambda x: unified_timestamp(x + ' +0200')}),
@ -76,6 +100,8 @@ class DuoplayIE(InfoExtractor):
'series_id': ('telecast_id', {str_or_none}),
'season_number': ('season_id', {int_or_none}),
'episode': 'subtitle',
'episode_number': (None, ('episode_nr', 'episode_id'), {int_or_none}),
}, get_all=False),
'episode_number': ('episode_nr', {int_or_none}),
'episode_id': ('episode_id', {int_or_none}),
'cast': ('cast', {lambda x: x.split(', ')}),
}),
}