From 2aa073f504802c3ede9573db23546bae2febba87 Mon Sep 17 00:00:00 2001 From: projectdx Date: Sun, 23 Oct 2022 23:01:29 +0900 Subject: [PATCH] anilife update 2022.10.23(01.) --- logic_anilife.py | 86 ++++++++++++++++++++++++++---------------------- 1 file changed, 47 insertions(+), 39 deletions(-) diff --git a/logic_anilife.py b/logic_anilife.py index b4c579c..280fbd3 100644 --- a/logic_anilife.py +++ b/logic_anilife.py @@ -181,43 +181,43 @@ class LogicAniLife(LogicModuleBase): import time browser_args = [ - '--window-size=1300,570', - '--window-position=000,000', - '--disable-dev-shm-usage', - '--no-sandbox', - '--disable-web-security', - '--disable-features=site-per-process', - '--disable-setuid-sandbox', - '--disable-accelerated-2d-canvas', - '--no-first-run', - '--no-zygote', + "--window-size=1300,570", + "--window-position=000,000", + "--disable-dev-shm-usage", + "--no-sandbox", + "--disable-web-security", + "--disable-features=site-per-process", + "--disable-setuid-sandbox", + "--disable-accelerated-2d-canvas", + "--no-first-run", + "--no-zygote", # '--single-process', - '--disable-gpu', - '--use-gl=egl', - '--disable-blink-features=AutomationControlled', - '--disable-background-networking', - '--enable-features=NetworkService,NetworkServiceInProcess', - '--disable-background-timer-throttling', - '--disable-backgrounding-occluded-windows', - '--disable-breakpad', - '--disable-client-side-phishing-detection', - '--disable-component-extensions-with-background-pages', - '--disable-default-apps', - '--disable-extensions', - '--disable-features=Translate', - '--disable-hang-monitor', - '--disable-ipc-flooding-protection', - '--disable-popup-blocking', - '--disable-prompt-on-repost', - '--disable-renderer-backgrounding', - '--disable-sync', - '--force-color-profile=srgb', - '--metrics-recording-only', - '--enable-automation', - '--password-store=basic', - '--use-mock-keychain', - '--hide-scrollbars', - '--mute-audio' + "--disable-gpu", + "--use-gl=egl", + "--disable-blink-features=AutomationControlled", + "--disable-background-networking", + "--enable-features=NetworkService,NetworkServiceInProcess", + "--disable-background-timer-throttling", + "--disable-backgrounding-occluded-windows", + "--disable-breakpad", + "--disable-client-side-phishing-detection", + "--disable-component-extensions-with-background-pages", + "--disable-default-apps", + "--disable-extensions", + "--disable-features=Translate", + "--disable-hang-monitor", + "--disable-ipc-flooding-protection", + "--disable-popup-blocking", + "--disable-prompt-on-repost", + "--disable-renderer-backgrounding", + "--disable-sync", + "--force-color-profile=srgb", + "--metrics-recording-only", + "--enable-automation", + "--password-store=basic", + "--use-mock-keychain", + "--hide-scrollbars", + "--mute-audio", ] # scraper = cloudscraper.create_scraper( # browser={"browser": "chrome", "platform": "windows", "desktop": True}, @@ -246,11 +246,19 @@ class LogicAniLife(LogicModuleBase): async with async_playwright() as p: if engine == "chrome": - browser = await p.chromium.launch(channel="chrome", args=browser_args, headless=headless) + browser = await p.chromium.launch( + channel="chrome", args=browser_args, headless=headless + ) elif engine == "webkit": - browser = await p.webkit.launch(headless=headless, args=browser_args,) + browser = await p.webkit.launch( + headless=headless, + args=browser_args, + ) else: - browser = await p.firefox.launch(headless=headless, args=browser_args,) + browser = await p.firefox.launch( + headless=headless, + args=browser_args, + ) # context = browser.new_context( # user_agent=ua, # )