[nrk] Fix age limit extraction

This commit is contained in:
=?UTF-8?q?Sergey=20M=E2=80=A4?= 2021-02-26 16:04:38 +01:00 committed by Laura Liberda
parent d9673551d7
commit eff203d3ae

View file

@ -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,
}