From ac9192619af52a3ac06aab4945a9d30d29e31f61 Mon Sep 17 00:00:00 2001 From: Laura Liberda Date: Thu, 11 Feb 2021 14:34:59 +0100 Subject: [PATCH] [pulsevideo] support age limit --- haruhi_dl/extractor/onet.py | 12 ++++++++++++ haruhi_dl/extractor/pulsembed.py | 2 ++ 2 files changed, 14 insertions(+) diff --git a/haruhi_dl/extractor/onet.py b/haruhi_dl/extractor/onet.py index 51cd713ca..8d5962edd 100644 --- a/haruhi_dl/extractor/onet.py +++ b/haruhi_dl/extractor/onet.py @@ -45,6 +45,18 @@ class OnetPlIE(InfoExtractor): 'timestamp': 1607108125, 'upload_date': '20201204', }, + }, { + # age limit + 'url': 'https://www.onet.pl/informacje/onetwiadomosci/krwawy-biznes-futerkowcow-film-janusza-schwertnera/82wy9vs,79cfc278', + 'info_dict': { + 'id': '2188984.870201019', + 'ext': 'mp4', + 'title': 'Szokujące nagrania. Tak się produkuje futra w Polsce. Film "Krwawy biznes futerkowców" Janusza Schwertnera', + 'description': 'Film "Krwawy biznes futerkowców" Janusza Schwertnera', + 'timestamp': 1599558803, + 'upload_date': '20200908', + 'age_limit': 18, + }, }, { 'url': 'http://film.onet.pl/zwiastuny/ghost-in-the-shell-drugi-zwiastun-pl/5q6yl3', 'only_matching': True, diff --git a/haruhi_dl/extractor/pulsembed.py b/haruhi_dl/extractor/pulsembed.py index 0151053eb..7a0a5b239 100644 --- a/haruhi_dl/extractor/pulsembed.py +++ b/haruhi_dl/extractor/pulsembed.py @@ -118,6 +118,7 @@ class PulseVideoIE(InfoExtractor): webpage, default=None) if webpage else None) or meta.get('description') duration = meta.get('length') or meta.get('lenght') timestamp = parse_iso8601(meta.get('addDate'), ' ') + age_limit = int_or_none(video['license'].get('rating', '')[len('rating_'):]) return { 'id': video_id, @@ -126,6 +127,7 @@ class PulseVideoIE(InfoExtractor): 'duration': duration, 'timestamp': timestamp, 'formats': formats, + 'age_limit': age_limit, } def _real_extract(self, url):