From cec8e95ce8d45a26d45a96cfb92252f091ccb338 Mon Sep 17 00:00:00 2001 From: Shuffling Key Maker Date: Fri, 11 Oct 2024 21:11:11 +0200 Subject: [PATCH] [ie/drtv] Fix series, season_number and geo-restriction extraction --- yt_dlp/extractor/drtv.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/yt_dlp/extractor/drtv.py b/yt_dlp/extractor/drtv.py index ba86eb2b49..0b88e07e51 100644 --- a/yt_dlp/extractor/drtv.py +++ b/yt_dlp/extractor/drtv.py @@ -222,9 +222,11 @@ def _real_extract(self, url): 'ext': mimetype2ext(sub_track.get('format')) or 'vtt', }) - if not formats and traverse_obj(item, ('season', 'customFields', 'IsGeoRestricted')): + if not formats and traverse_obj(item, ('customFields', 'IsGeoRestricted')): self.raise_geo_restricted(countries=self._GEO_COUNTRIES) + season_id = traverse_obj(item, ('seasonId')) + return { 'id': video_id, 'formats': formats, @@ -236,9 +238,9 @@ def _real_extract(self, url): 'thumbnail': ('images', 'wallpaper'), 'release_timestamp': ('customFields', 'BroadcastTimeDK', {parse_iso8601}), 'duration': ('duration', {int_or_none}), - 'series': ('season', 'show', 'title'), + 'series': ('show', 'title'), 'season': ('season', 'title'), - 'season_number': ('season', 'seasonNumber', {int_or_none}), + 'season_number': ('show', 'seasons', 'items', (lambda _, v: season_id == v['id']), any, 'seasonNumber', {int_or_none}), 'season_id': 'seasonId', 'episode': 'episodeName', 'episode_number': ('episodeNumber', {int_or_none}),