fix release_year extraction for edge cases

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
This commit is contained in:
v3DJG6GL 2025-05-09 13:24:29 +02:00 committed by GitHub
parent 2bb735e47c
commit fa7b182291
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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}),