From fa7b182291e112a8055580348af50df816934a71 Mon Sep 17 00:00:00 2001 From: v3DJG6GL <72495210+v3DJG6GL@users.noreply.github.com> Date: Fri, 9 May 2025 13:24:29 +0200 Subject: [PATCH] fix release_year extraction for edge cases MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit only use the first four characters. This handles cases in which the value “year” consists of more than one year. Example: https://www.playsuisse.ch/detail/947691 --- yt_dlp/extractor/playsuisse.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yt_dlp/extractor/playsuisse.py b/yt_dlp/extractor/playsuisse.py index f11f643223..cdcd707643 100644 --- a/yt_dlp/extractor/playsuisse.py +++ b/yt_dlp/extractor/playsuisse.py @@ -56,7 +56,7 @@ class PlaySuisseIE(InfoExtractor): 'cast': 'Fabrizio Rongione; Stéphanie Cléau; Gilles Privat; Alexandre Trocki', 'location': 'France; Argentine', 'release_year': 2021, - 'duration': 5715, + 'duration': 5981, 'thumbnail': 're:https://playsuisse-img.akamaized.net/', }, }, { @@ -283,7 +283,7 @@ class PlaySuisseIE(InfoExtractor): 'creators': ('directors', ..., {str}, all, {unpack(join_nonempty, delim='; ')}, filter), 'cast': ('mainCast', ..., {str}, all, {unpack(join_nonempty, delim='; ')}, filter), 'location': ('productionCountries', ..., {str}, all, {unpack(join_nonempty, delim='; ')}, filter), - 'release_year': ('year', {int_or_none}), + 'release_year': ('year', {str}, {lambda x: x[:4]}, {int_or_none}), 'duration': ('duration', {int_or_none}), 'series': ('seriesName', {str}), 'season_number': ('seasonNumber', {int_or_none}),