From 80d03d7e69c6462ad54d51f58a858b1af0ba18a6 Mon Sep 17 00:00:00 2001 From: dirkf Date: Wed, 9 Oct 2024 01:47:18 +0100 Subject: [PATCH] Fix/improve timestamp, categories, tags --- youtube_dl/extractor/sbs.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/youtube_dl/extractor/sbs.py b/youtube_dl/extractor/sbs.py index a319abdd0..28333eaa1 100644 --- a/youtube_dl/extractor/sbs.py +++ b/youtube_dl/extractor/sbs.py @@ -55,8 +55,8 @@ class SBSIE(InfoExtractor): 'timestamp': 1408613220, 'upload_date': '20140821', 'uploader': 'SBSC', - 'tags': None, - 'categories': None, + 'tags': 'mincount:10', + 'categories': 'count:2', }, 'expected_warnings': ['Unable to download JSON metadata'], }, { @@ -198,17 +198,22 @@ class SBSIE(InfoExtractor): 'season_number': (('partOfSeries', None), 'seasonNumber', T(int_or_none)), 'episode': ('epName', T(str)), 'episode_number': ('episodeNumber', T(int_or_none)), - 'timestamp': ('datePublished', ('publication', 'startDate'), T(parse_iso8601)), + 'timestamp': (('datePublished', ('publication', 'startDate')), T(parse_iso8601)), 'release_year': ('releaseYear', T(int_or_none)), 'duration': ('duration', T(really_parse_duration)), 'is_live': ('liveStream', T(bool)), 'age_limit': ('classificationID', 'contentRating', T(lambda x: self.AUS_TV_PARENTAL_GUIDELINES.get(x, '').upper() or None)), # dict.get is unhashable in py3.7 }, get_all=False), traverse_obj(media, { - 'categories': (('genres', Ellipsis), ('taxonomy', ('genre', 'subgenre'), - 'name', T(str))), - 'tags': (('consumerAdviceTexts', ('sbsSubCertification', 'consumerAdvice')), - Ellipsis, T(str)), + 'categories': ((('genres', Ellipsis), + ('taxonomy', ((('genre', 'subgenre'), Ellipsis, 'name'), 'useType'))), + T(str)), + 'tags': ((((('keywords',), + ('consumerAdviceTexts', ('sbsSubCertification', 'consumerAdvice'))), + Ellipsis), + ('taxonomy', ('era', 'location', 'section', 'subject', 'theme'), + Ellipsis, 'name')), + T(str)), 'thumbnails': ('thumbnails', lambda _, v: v['contentUrl'], T(mk_thumb)), }), { 'formats': formats,