From 457ef9b4b50b1bc538a2c98f27c7274d768f45a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=3D=3FUTF-8=3Fq=3FSergey=3D20M=3DE2=3D80=3DA4=3F=3D?= Date: Fri, 26 Feb 2021 15:20:52 +0100 Subject: [PATCH] [generic] Improve RSS age limit extraction --- haruhi_dl/extractor/generic.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/haruhi_dl/extractor/generic.py b/haruhi_dl/extractor/generic.py index 181ccd491..240de66da 100644 --- a/haruhi_dl/extractor/generic.py +++ b/haruhi_dl/extractor/generic.py @@ -238,10 +238,13 @@ class GenericIE(InfoExtractor): 'id': 'c1c879525ce2cb640b344507e682c36d', 'title': 're:Hydrogen!', 'description': 're:.*In this episode we are going.*', - 'timestamp': int, + 'timestamp': 1567977776, 'upload_date': '20190908', - 'duration': int, + 'duration': 459, 'thumbnail': r're:^https?://.*\.jpg$', + 'episode_number': 1, + 'season_number': 1, + 'age_limit': 0, }, }], 'params': { @@ -2280,10 +2283,10 @@ class GenericIE(InfoExtractor): default=None) duration = itunes('duration') - explicit = itunes('explicit') - if explicit == 'true': + explicit = (itunes('explicit') or '').lower() + if explicit in ('true', 'yes'): age_limit = 18 - elif explicit == 'false': + elif explicit in ('false', 'no'): age_limit = 0 else: age_limit = None