1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-11-24 19:22:06 +00:00

Fix/improve timestamp, categories, tags

This commit is contained in:
dirkf 2024-10-09 01:47:18 +01:00 committed by GitHub
parent 3abae00087
commit 80d03d7e69
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -55,8 +55,8 @@ class SBSIE(InfoExtractor):
'timestamp': 1408613220, 'timestamp': 1408613220,
'upload_date': '20140821', 'upload_date': '20140821',
'uploader': 'SBSC', 'uploader': 'SBSC',
'tags': None, 'tags': 'mincount:10',
'categories': None, 'categories': 'count:2',
}, },
'expected_warnings': ['Unable to download JSON metadata'], 'expected_warnings': ['Unable to download JSON metadata'],
}, { }, {
@ -198,17 +198,22 @@ class SBSIE(InfoExtractor):
'season_number': (('partOfSeries', None), 'seasonNumber', T(int_or_none)), 'season_number': (('partOfSeries', None), 'seasonNumber', T(int_or_none)),
'episode': ('epName', T(str)), 'episode': ('epName', T(str)),
'episode_number': ('episodeNumber', T(int_or_none)), '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)), 'release_year': ('releaseYear', T(int_or_none)),
'duration': ('duration', T(really_parse_duration)), 'duration': ('duration', T(really_parse_duration)),
'is_live': ('liveStream', T(bool)), 'is_live': ('liveStream', T(bool)),
'age_limit': ('classificationID', 'contentRating', 'age_limit': ('classificationID', 'contentRating',
T(lambda x: self.AUS_TV_PARENTAL_GUIDELINES.get(x, '').upper() or None)), # dict.get is unhashable in py3.7 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, { }, get_all=False), traverse_obj(media, {
'categories': (('genres', Ellipsis), ('taxonomy', ('genre', 'subgenre'), 'categories': ((('genres', Ellipsis),
'name', T(str))), ('taxonomy', ((('genre', 'subgenre'), Ellipsis, 'name'), 'useType'))),
'tags': (('consumerAdviceTexts', ('sbsSubCertification', 'consumerAdvice')), T(str)),
Ellipsis, 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)), 'thumbnails': ('thumbnails', lambda _, v: v['contentUrl'], T(mk_thumb)),
}), { }), {
'formats': formats, 'formats': formats,