summary refs log tree commit diff
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2021-01-03 06:51:21 +0700
committerSergey M․ <dstftw@gmail.com>2021-01-03 06:51:21 +0700
commita25d03d7cb52111fab906c2c180f9bdf2c52ed12 (patch)
treebc12f3d50b1bb5a1ca5a839adf23ed1af7fb9693
parentcabfd4b1f0354518068bbdf0718cd36497d5c8a3 (diff)
downloadyoutube-dl-a25d03d7cb52111fab906c2c180f9bdf2c52ed12.tar.gz
youtube-dl-a25d03d7cb52111fab906c2c180f9bdf2c52ed12.tar.xz
youtube-dl-a25d03d7cb52111fab906c2c180f9bdf2c52ed12.zip
[nrk] Fix age limit extraction
-rw-r--r--youtube_dl/extractor/nrk.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/youtube_dl/extractor/nrk.py b/youtube_dl/extractor/nrk.py
index 520206534..d023de7f7 100644
--- a/youtube_dl/extractor/nrk.py
+++ b/youtube_dl/extractor/nrk.py
@@ -204,6 +204,9 @@ class NRKIE(NRKBaseIE):
                 'height': int_or_none(image.get('pixelHeight')),
             })
 
+        age_limit = int_or_none(try_get(
+            data, lambda x: x['legalAge']['body']['rating']['code']))
+
         return {
             'id': video_id,
             'title': title,
@@ -211,6 +214,7 @@ class NRKIE(NRKBaseIE):
             'description': description,
             'duration': duration,
             'thumbnails': thumbnails,
+            'age_limit': age_limit,
             'formats': formats,
         }