Compare commits

..

2 Commits

Author SHA1 Message Date
v3DJG6GL
fa7b182291
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
2025-05-09 13:24:29 +02:00
v3DJG6GL
2bb735e47c
fix metadata extraction for genres/creators/cast, fix tests 2025-05-09 12:35:17 +02:00

View File

@ -28,12 +28,12 @@ class PlaySuisseIE(InfoExtractor):
{ {
# episode in a series # episode in a series
'url': 'https://www.playsuisse.ch/watch/763182?episodeId=763211', 'url': 'https://www.playsuisse.ch/watch/763182?episodeId=763211',
'md5': '82df2a470b2dfa60c2d33772a8a60cf8', 'md5': 'e20d1ede6872a03b41905ca1060a1ef2',
'info_dict': { 'info_dict': {
'id': '763211', 'id': '763211',
'ext': 'mp4', 'ext': 'mp4',
'title': 'Knochen', 'title': 'Knochen',
'description': 'md5:2f88aab021fe3ba4b301ad7456b14cbb', 'description': 'md5:3bdd80e2ce20227c47aab1df2a79a519',
'duration': 3344, 'duration': 3344,
'series': 'Wilder', 'series': 'Wilder',
'season': 'Season 1', 'season': 'Season 1',
@ -45,18 +45,18 @@ class PlaySuisseIE(InfoExtractor):
}, { }, {
# film # film
'url': 'https://www.playsuisse.ch/detail/2573198', 'url': 'https://www.playsuisse.ch/detail/2573198',
'md5': '818b94c1d2d7c4beef953f12cb8f3e75', 'md5': '1f115bb0a5191477b1a5771643a4283d',
'info_dict': { 'info_dict': {
'id': '2573198', 'id': '2573198',
'ext': 'mp4', 'ext': 'mp4',
'title': 'Azor', 'title': 'Azor',
'description': 'md5:1550b151bc818fd0d12f6517d9821ddc', 'description': 'md5:d41d8cd98f00b204e9800998ecf8427e',
'genres': 'Fiction', 'genres': 'Fiction',
'creators': 'Andreas Fontana', 'creators': 'Andreas Fontana',
'cast': 'Fabrizio Rongione, Stéphanie Cléau, Gilles Privat, Alexandre Trocki', 'cast': 'Fabrizio Rongione; Stéphanie Cléau; Gilles Privat; Alexandre Trocki',
'location': 'France, Argentine', 'location': 'France; Argentine',
'year': '2021', 'release_year': 2021,
'duration': 5715, 'duration': 5981,
'thumbnail': 're:https://playsuisse-img.akamaized.net/', 'thumbnail': 're:https://playsuisse-img.akamaized.net/',
}, },
}, { }, {
@ -70,7 +70,7 @@ class PlaySuisseIE(InfoExtractor):
'genres': 'Documentary', 'genres': 'Documentary',
'creators': 'Oliver Murray', 'creators': 'Oliver Murray',
'location': 'Switzerland', 'location': 'Switzerland',
'year': '2021', 'release_year': 2021,
}, },
'playlist': [{ 'playlist': [{
'info_dict': { 'info_dict': {
@ -279,11 +279,11 @@ class PlaySuisseIE(InfoExtractor):
'id': ('id', {str}), 'id': ('id', {str}),
'title': ('name', {str}), 'title': ('name', {str}),
'description': (('descriptionLong', 'description'), {str}, any), 'description': (('descriptionLong', 'description'), {str}, any),
'genres': ('contentTypes', ..., {str}), 'genres': ('contentTypes', ..., {str}, all, {unpack(join_nonempty, delim='; ')}, filter),
'creators': ('directors', ..., {str}), 'creators': ('directors', ..., {str}, all, {unpack(join_nonempty, delim='; ')}, filter),
'cast': ('mainCast', ..., {str}), 'cast': ('mainCast', ..., {str}, all, {unpack(join_nonempty, delim='; ')}, filter),
'location': ('productionCountries', ..., {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}), 'duration': ('duration', {int_or_none}),
'series': ('seriesName', {str}), 'series': ('seriesName', {str}),
'season_number': ('seasonNumber', {int_or_none}), 'season_number': ('seasonNumber', {int_or_none}),