ohli24 api update 2023.01.13(01.)
This commit is contained in:
@@ -121,43 +121,59 @@ class LogicOhli24(LogicModuleBase):
|
|||||||
import time
|
import time
|
||||||
|
|
||||||
cookie = None
|
cookie = None
|
||||||
|
# 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",
|
||||||
|
# ]
|
||||||
browser_args = [
|
browser_args = [
|
||||||
"--window-size=1300,570",
|
"--window-size=1300,570",
|
||||||
"--window-position=000,000",
|
"--window-position=0,0",
|
||||||
"--disable-dev-shm-usage",
|
# "--disable-dev-shm-usage",
|
||||||
"--no-sandbox",
|
"--no-sandbox",
|
||||||
"--disable-web-security",
|
# "--disable-web-security",
|
||||||
"--disable-features=site-per-process",
|
# "--disable-features=site-per-process",
|
||||||
"--disable-setuid-sandbox",
|
# "--disable-setuid-sandbox",
|
||||||
"--disable-accelerated-2d-canvas",
|
# "--disable-accelerated-2d-canvas",
|
||||||
"--no-first-run",
|
# "--no-first-run",
|
||||||
"--no-zygote",
|
# "--no-zygote",
|
||||||
# '--single-process',
|
# "--single-process",
|
||||||
"--disable-gpu",
|
"--disable-gpu",
|
||||||
"--use-gl=egl",
|
# "--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",
|
"--mute-audio",
|
||||||
]
|
]
|
||||||
# scraper = cloudscraper.create_scraper(
|
# scraper = cloudscraper.create_scraper(
|
||||||
@@ -223,7 +239,7 @@ class LogicOhli24(LogicModuleBase):
|
|||||||
|
|
||||||
# LogicAniLife.headers["Cookie"] = cookie_value
|
# LogicAniLife.headers["Cookie"] = cookie_value
|
||||||
|
|
||||||
await context.set_extra_http_headers(LogicOhli24.headers)
|
# await context.set_extra_http_headers(LogicOhli24.headers)
|
||||||
|
|
||||||
page = await context.new_page()
|
page = await context.new_page()
|
||||||
|
|
||||||
@@ -246,12 +262,12 @@ class LogicOhli24(LogicModuleBase):
|
|||||||
# networkidle
|
# networkidle
|
||||||
await page.goto(
|
await page.goto(
|
||||||
url,
|
url,
|
||||||
wait_until="networkidle",
|
wait_until="load",
|
||||||
referer=LogicOhli24.headers["Referer"],
|
referer=LogicOhli24.headers["Referer"],
|
||||||
)
|
)
|
||||||
# page.wait_for_timeout(10000)
|
# page.wait_for_timeout(10000)
|
||||||
# await asyncio.sleep(2.9)
|
# await asyncio.sleep(2.9)
|
||||||
await asyncio.sleep(6)
|
await asyncio.sleep(1)
|
||||||
|
|
||||||
# await page.reload()
|
# await page.reload()
|
||||||
|
|
||||||
@@ -950,7 +966,7 @@ class LogicOhli24(LogicModuleBase):
|
|||||||
response_data = asyncio.run(
|
response_data = asyncio.run(
|
||||||
LogicOhli24.get_html_playwright(
|
LogicOhli24.get_html_playwright(
|
||||||
url,
|
url,
|
||||||
headless=False,
|
headless=True,
|
||||||
# referer=referer_url,
|
# referer=referer_url,
|
||||||
engine="chrome",
|
engine="chrome",
|
||||||
# stealth=stealth,
|
# stealth=stealth,
|
||||||
|
|||||||
Reference in New Issue
Block a user