Compare commits

..

7 Commits

Author SHA1 Message Date
Elan Ruusamäe
4cc9137f11 Strip synopsis for extra newline 2023-11-09 18:35:04 +02:00
Elan Ruusamäe
b461c28ba2 Fallback to absolute episode id for episoder number 2023-11-09 01:46:19 +02:00
Elan Ruusamäe
6ea78d890d Add test data for first test item 2023-11-09 01:39:21 +02:00
Elan Ruusamäe
1301c71868 fixup! Add test for example with no title 2023-11-09 01:37:54 +02:00
Elan Ruusamäe
34bbe847fd Add test for example with no title 2023-11-09 01:37:48 +02:00
Elan Ruusamäe
9a3c374589 Pass series_id and episode_id metadata 2023-11-09 01:36:53 +02:00
Elan Ruusamäe
13d896e9b3 Add fallback to absolute episode id in case of missing subtitle 2023-11-09 01:36:40 +02:00

View File

@ -2,6 +2,7 @@ from .common import InfoExtractor
from ..utils import ( from ..utils import (
traverse_obj, traverse_obj,
unified_timestamp, unified_timestamp,
strip_or_none,
) )
@ -20,10 +21,30 @@ class DuoplayIE(InfoExtractor):
'upload_date': '20170523', 'upload_date': '20170523',
'timestamp': 1495567800, 'timestamp': 1495567800,
'series': 'Siberi võmm', 'series': 'Siberi võmm',
'series_id': 4312,
'season': 'Season 2', 'season': 'Season 2',
'season_number': 2, 'season_number': 2,
'episode': 'Operatsioon "Öö"', 'episode': 'Operatsioon "Öö"',
'episode_number': 12, 'episode_number': 12,
'episode_id': 24,
},
}, {
'note': 'Empty title',
'url': 'https://duoplay.ee/17/uhikarotid?ep=14',
'md5': '6aca68be71112314738dd17cced7f8bf',
'info_dict': {
'id': '17',
'ext': 'mp4',
'title': 'Episode 14',
'thumbnail': r're:https://.+\.jpg(?:\?c=\d+)?$',
'description': 'md5:4719b418e058c209def41d48b601276e',
'upload_date': '20100916',
'timestamp': 1284661800,
'series': 'Ühikarotid',
'series_id': 17,
'season': 'Season 2',
'season_number': 2,
'episode_id': 14,
}, },
}] }]
@ -39,13 +60,17 @@ class DuoplayIE(InfoExtractor):
return { return {
'id': video_id, 'id': video_id,
'title': traverse_obj(ep, 'subtitle'), # fallback to absolute "episode_id" value
'description': traverse_obj(ep, 'synopsis'), 'title': traverse_obj(ep, 'subtitle') or f"Episode {traverse_obj(ep, 'episode_id')}",
'description': strip_or_none(traverse_obj(ep, 'synopsis')),
'thumbnail': traverse_obj(ep, ('images', 'original')), 'thumbnail': traverse_obj(ep, ('images', 'original')),
'formats': self._extract_m3u8_formats(manifest_url, video_id, 'mp4'), 'formats': self._extract_m3u8_formats(manifest_url, video_id, 'mp4'),
'timestamp': unified_timestamp(traverse_obj(ep, 'airtime') + ' +0200'), 'timestamp': unified_timestamp(traverse_obj(ep, 'airtime') + ' +0200'),
'series': traverse_obj(ep, 'title'), 'series': traverse_obj(ep, 'title'),
'series_id': traverse_obj(ep, 'telecast_id'),
'season_number': traverse_obj(ep, 'season_id'), 'season_number': traverse_obj(ep, 'season_id'),
'episode': traverse_obj(ep, 'subtitle'), 'episode': traverse_obj(ep, 'subtitle'),
'episode_number': traverse_obj(ep, 'episode_nr'), # fallback to absolute "episode_id" value
'episode_number': traverse_obj(ep, 'episode_nr') or traverse_obj(ep, 'episode_id'),
'episode_id': traverse_obj(ep, 'episode_id'),
} }