From bf49e2d1b398d4901243115746b9fd14a71aceda Mon Sep 17 00:00:00 2001 From: flewsea Date: Thu, 27 Feb 2020 22:38:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E4=B8=8B=E8=BD=BD=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=86=85=E6=89=80=E6=9C=89=E8=A7=86=E9=A2=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/you_get/extractors/iwara.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/you_get/extractors/iwara.py b/src/you_get/extractors/iwara.py index a30159d7..67a41d41 100644 --- a/src/you_get/extractors/iwara.py +++ b/src/you_get/extractors/iwara.py @@ -9,12 +9,15 @@ headers = { 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.75 Safari/537.36', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'Cache-Control': 'max-age=0', - 'Connection': 'keep-alive', 'Save-Data': 'on', 'Cookie':'has_js=1;show_adult=1', } - +stream_types = [ + {'id': 'Source', 'container': 'mp4', 'video_profile': '原始'}, + {'id': '540p', 'container': 'mp4', 'video_profile': '540p'}, + {'id': '360p', 'container': 'mp4', 'video_profile': '360P'}, + ] def iwara_download(url, output_dir='.', merge=True, info_only=False, **kwargs): global headers video_hash = match1(url, r'https?://\w+.iwara.tv/videos/(\w+)') @@ -31,6 +34,17 @@ def iwara_download(url, output_dir='.', merge=True, info_only=False, **kwargs): if not info_only: download_urls([down_urls], title, ext, size, output_dir, merge=merge, headers=headers) +def download_playlist_by_url( url, **kwargs): + video_page = get_content(url) + # url_first=re.findall(r"(http[s]?://[^/]+)",url) + url_first=match1(url, r"(http[s]?://[^/]+)") + # print (url_first) + videos = set(re.findall(r'0): + for video in videos: + iwara_download(url_first+video, **kwargs) + else: + maybe_print('this page not found any videos') site_info = "Iwara" download = iwara_download -download_playlist = playlist_not_supported('iwara') +download_playlist = download_playlist_by_url