浏览代码

[nrk] Fix age limit extraction

Sergey M․ 4 年之前
父节点
当前提交
a25d03d7cb
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      youtube_dl/extractor/nrk.py

+ 4 - 0
youtube_dl/extractor/nrk.py

@@ -204,6 +204,9 @@ class NRKIE(NRKBaseIE):
                 'height': int_or_none(image.get('pixelHeight')),
                 'height': int_or_none(image.get('pixelHeight')),
             })
             })
 
 
+        age_limit = int_or_none(try_get(
+            data, lambda x: x['legalAge']['body']['rating']['code']))
+
         return {
         return {
             'id': video_id,
             'id': video_id,
             'title': title,
             'title': title,
@@ -211,6 +214,7 @@ class NRKIE(NRKBaseIE):
             'description': description,
             'description': description,
             'duration': duration,
             'duration': duration,
             'thumbnails': thumbnails,
             'thumbnails': thumbnails,
+            'age_limit': age_limit,
             'formats': formats,
             'formats': formats,
         }
         }