[generic] Improve RSS age limit extraction

This commit is contained in:
=?UTF-8?q?Sergey=20M=E2=80=A4?= 2021-02-26 15:20:52 +01:00 committed by Laura Liberda
parent c359b19034
commit 457ef9b4b5

View file

@ -238,10 +238,13 @@ class GenericIE(InfoExtractor):
'id': 'c1c879525ce2cb640b344507e682c36d', 'id': 'c1c879525ce2cb640b344507e682c36d',
'title': 're:Hydrogen!', 'title': 're:Hydrogen!',
'description': 're:.*In this episode we are going.*', 'description': 're:.*In this episode we are going.*',
'timestamp': int, 'timestamp': 1567977776,
'upload_date': '20190908', 'upload_date': '20190908',
'duration': int, 'duration': 459,
'thumbnail': r're:^https?://.*\.jpg$', 'thumbnail': r're:^https?://.*\.jpg$',
'episode_number': 1,
'season_number': 1,
'age_limit': 0,
}, },
}], }],
'params': { 'params': {
@ -2280,10 +2283,10 @@ class GenericIE(InfoExtractor):
default=None) default=None)
duration = itunes('duration') duration = itunes('duration')
explicit = itunes('explicit') explicit = (itunes('explicit') or '').lower()
if explicit == 'true': if explicit in ('true', 'yes'):
age_limit = 18 age_limit = 18
elif explicit == 'false': elif explicit in ('false', 'no'):
age_limit = 0 age_limit = 0
else: else:
age_limit = None age_limit = None