diff options
author | Remita Amine <remitamine@gmail.com> | 2021-01-04 12:16:54 +0100 |
---|---|---|
committer | Remita Amine <remitamine@gmail.com> | 2021-01-04 12:16:54 +0100 |
commit | 8a3797a4abdc0b63b6fcbd1fbc9d81acc57ec142 (patch) | |
tree | 8b103c5087f02e551755fd319762121506467029 /youtube_dl | |
parent | 745db8899d77c56bf14443be60970aed1d9e2bdd (diff) |
[nrk] fix extraction for videos without a legalAge rating
Diffstat (limited to 'youtube_dl')
-rw-r--r-- | youtube_dl/extractor/nrk.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/youtube_dl/extractor/nrk.py b/youtube_dl/extractor/nrk.py index cafb85616..40dee2162 100644 --- a/youtube_dl/extractor/nrk.py +++ b/youtube_dl/extractor/nrk.py @@ -223,12 +223,12 @@ class NRKIE(NRKBaseIE): legal_age = try_get( data, lambda x: x['legalAge']['body']['rating']['code'], compat_str) # https://en.wikipedia.org/wiki/Norwegian_Media_Authority - if legal_age == 'A': - age_limit = 0 - elif legal_age.isdigit(): - age_limit = int_or_none(legal_age) - else: - age_limit = None + age_limit = None + if legal_age: + if legal_age == 'A': + age_limit = 0 + elif legal_age.isdigit(): + age_limit = int_or_none(legal_age) is_series = try_get(data, lambda x: x['_links']['series']['name']) == 'series' |