From af73adf1aa3a9c33ab8bbe7248208aa0fd55b7c5 Mon Sep 17 00:00:00 2001 From: projectdx Date: Mon, 24 Oct 2022 03:59:32 +0900 Subject: [PATCH] anilife update 2022.10.24(01.) --- logic_anilife.py | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/logic_anilife.py b/logic_anilife.py index de87ee1..f4bff36 100644 --- a/logic_anilife.py +++ b/logic_anilife.py @@ -102,7 +102,7 @@ class LogicAniLife(LogicModuleBase): } useragent = { "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, " - "like Gecko) Chrome/96.0.4664.110 Whale/3.12.129.46 Safari/537.36" + "like Gecko) Chrome/96.0.4664.110 Whale/3.12.129.46 Safari/537.36" } def __init__(self, P): @@ -112,7 +112,9 @@ class LogicAniLife(LogicModuleBase): default_route_socketio(P, self) @staticmethod - def get_html(url: str, referer: str = None, stream: bool = False, timeout: int = 5) -> str: + def get_html( + url: str, referer: str = None, stream: bool = False, timeout: int = 5 + ) -> str: data = "" try: print("cloudflare protection bypass ==================") @@ -143,7 +145,9 @@ class LogicAniLife(LogicModuleBase): return data @staticmethod - def get_html_requests(url: str, referer: str = None, stream: str = False, timeout: int = 5) -> str: + def get_html_requests( + url: str, referer: str = None, stream: str = False, timeout: int = 5 + ) -> str: data = "" try: print("get_html_requests ==================") @@ -173,7 +177,11 @@ class LogicAniLife(LogicModuleBase): @staticmethod async def get_html_playwright( - url: str, headless: bool = False, referer: str = None, engine: str = "chrome", stealth: bool = False + url: str, + headless: bool = False, + referer: str = None, + engine: str = "chrome", + stealth: bool = False, ) -> str: try: from playwright.sync_api import sync_playwright @@ -338,7 +346,7 @@ class LogicAniLife(LogicModuleBase): @staticmethod async def get_vod_url_v1( - url, headless=False, referer=None, engine="chrome", stealth=False + url, headless=False, referer=None, engine="chrome", stealth=False ): from playwright.sync_api import sync_playwright from playwright.async_api import async_playwright @@ -853,7 +861,7 @@ class LogicAniLife(LogicModuleBase): def setting_save_after(self): if self.queue.get_max_ffmpeg_count() != P.ModelSetting.get_int( - "anilife_max_ffmpeg_process_count" + "anilife_max_ffmpeg_process_count" ): self.queue.set_max_ffmpeg_count( P.ModelSetting.get_int("anilife_max_ffmpeg_process_count") @@ -1032,16 +1040,16 @@ class LogicAniLife(LogicModuleBase): ) elif cate == "theater": url = ( - P.ModelSetting.get("anilife_url") - + "/vodtype/categorize/Movie/" - + page + P.ModelSetting.get("anilife_url") + + "/vodtype/categorize/Movie/" + + page ) wrapper_xpath = '//div[@class="bsx"]' else: url = ( - P.ModelSetting.get("anilife_url") - + "/vodtype/categorize/Movie/" - + page + P.ModelSetting.get("anilife_url") + + "/vodtype/categorize/Movie/" + + page ) # cate == "complete": logger.info("url:::> %s", url)