From 9aaf20b0ed975f44aae283b887ce0041d11be970 Mon Sep 17 00:00:00 2001 From: BrutuZ Date: Thu, 12 Mar 2020 21:24:00 -0300 Subject: [PATCH] Requested changes --- youtube_dl/extractor/hanime.py | 58 +++++++++++++++------------------- 1 file changed, 26 insertions(+), 32 deletions(-) diff --git a/youtube_dl/extractor/hanime.py b/youtube_dl/extractor/hanime.py index 05c23f225..8f1c81e9c 100644 --- a/youtube_dl/extractor/hanime.py +++ b/youtube_dl/extractor/hanime.py @@ -7,10 +7,13 @@ from ..utils import ( parse_filesize, float_or_none, int_or_none, + parse_iso8601, unified_strdate, str_or_none, - url_or_none, parse_duration, + sanitize_url, + compat_str, + try_get, ) @@ -26,12 +29,12 @@ class HanimeIE(InfoExtractor): 'thumbnail': r're:^https?://.*\.jpg$', 'release_date': '20120127', 'upload_date': '20140509', + 'timestamp': 1399624976, 'creator': 'Magin Label', 'view_count': int, 'like_count': int, 'dislike_count': int, 'tags': list, - 'censored': 'True', 'ext': 'mp4', }, 'params': { @@ -42,60 +45,51 @@ class HanimeIE(InfoExtractor): def _real_extract(self, url): video_slug = self._match_id(url) - - webpage = self._download_webpage(url, video_slug) - page_json = self._html_search_regex(r'window.__NUXT__=(.+?);<\/script>', webpage, 'Inline JSON') - page_json = self._parse_json(page_json, video_slug).get('state').get('data').get('video').get('hentai_video') + page_json = self._html_search_regex(r'