anilife update 2022.10.23(01.)
This commit is contained in:
@@ -180,6 +180,45 @@ 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',
|
||||
# '--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'
|
||||
]
|
||||
# scraper = cloudscraper.create_scraper(
|
||||
# browser={"browser": "chrome", "platform": "windows", "desktop": True},
|
||||
# debug=False,
|
||||
@@ -207,11 +246,11 @@ class LogicAniLife(LogicModuleBase):
|
||||
|
||||
async with async_playwright() as p:
|
||||
if engine == "chrome":
|
||||
browser = await p.chromium.launch(channel="chrome", headless=headless)
|
||||
browser = await p.chromium.launch(channel="chrome", args=browser_args, headless=headless)
|
||||
elif engine == "webkit":
|
||||
browser = await p.webkit.launch(headless=headless)
|
||||
browser = await p.webkit.launch(headless=headless, args=browser_args,)
|
||||
else:
|
||||
browser = await p.firefox.launch(headless=headless)
|
||||
browser = await p.firefox.launch(headless=headless, args=browser_args,)
|
||||
# context = browser.new_context(
|
||||
# user_agent=ua,
|
||||
# )
|
||||
@@ -1111,7 +1150,7 @@ class AniLifeQueueEntity(FfmpegQueueEntity):
|
||||
text = asyncio.run(
|
||||
LogicAniLife.get_html_playwright(
|
||||
url,
|
||||
headless=False,
|
||||
headless=True,
|
||||
referer=referer_url,
|
||||
engine="chrome",
|
||||
stealth=True,
|
||||
|
||||
Reference in New Issue
Block a user