2022.01.31 anilife 버그 픽스 (.01)
This commit is contained in:
112
logic_anilife.py
112
logic_anilife.py
@@ -178,43 +178,59 @@ class LogicAniLife(LogicModuleBase):
|
||||
import time
|
||||
|
||||
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 = [
|
||||
"--window-size=1300,570",
|
||||
"--window-position=000,000",
|
||||
"--disable-dev-shm-usage",
|
||||
"--window-position=0,0",
|
||||
# "--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-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",
|
||||
# "--use-gl=egl",
|
||||
"--mute-audio",
|
||||
]
|
||||
# scraper = cloudscraper.create_scraper(
|
||||
@@ -302,7 +318,8 @@ class LogicAniLife(LogicModuleBase):
|
||||
url, wait_until="load", referer=LogicAniLife.headers["Referer"]
|
||||
)
|
||||
# page.wait_for_timeout(10000)
|
||||
await asyncio.sleep(2.9)
|
||||
# await asyncio.sleep(2.9)
|
||||
await asyncio.sleep(1)
|
||||
|
||||
# await page.reload()
|
||||
|
||||
@@ -313,11 +330,13 @@ class LogicAniLife(LogicModuleBase):
|
||||
print(f"page.url:: {page.url}")
|
||||
LogicAniLife.origin_url = page.url
|
||||
|
||||
# print(page.content())
|
||||
temp_content = await page.content()
|
||||
#
|
||||
# print(temp_content)
|
||||
|
||||
print(f"run at {time.time() - start} sec")
|
||||
|
||||
return await page.content()
|
||||
return temp_content
|
||||
except Exception as e:
|
||||
logger.error("Exception:%s", e)
|
||||
logger.error(traceback.format_exc())
|
||||
@@ -922,8 +941,25 @@ class LogicAniLife(LogicModuleBase):
|
||||
return jsonify(ModelAniLifeItem.web_list(request))
|
||||
elif sub == "db_remove":
|
||||
return jsonify(ModelAniLifeItem.delete_by_id(req.form["id"]))
|
||||
elif sub == "add_whitelist":
|
||||
try:
|
||||
# params = request.get_data()
|
||||
# logger.debug(f"params: {params}")
|
||||
# data_code = request.args.get("data_code")
|
||||
params = request.get_json()
|
||||
logger.debug(f"params:: {params}")
|
||||
if params is not None:
|
||||
code = params["data_code"]
|
||||
logger.debug(f"params: {code}")
|
||||
ret = LogicOhli24.add_whitelist(code)
|
||||
else:
|
||||
ret = LogicOhli24.add_whitelist()
|
||||
return jsonify(ret)
|
||||
except Exception as e:
|
||||
logger.error("Exception:%s", e)
|
||||
logger.error(traceback.format_exc())
|
||||
except Exception as e:
|
||||
P.logger.error("Exception:%s", e)
|
||||
P.logger.error(f"Exception: {str(e)}")
|
||||
P.logger.error(traceback.format_exc())
|
||||
|
||||
@staticmethod
|
||||
@@ -1268,7 +1304,7 @@ class AniLifeQueueEntity(FfmpegQueueEntity):
|
||||
db_entity = ModelAniLifeItem.get_by_anilife_id(self.info["_id"])
|
||||
if db_entity is not None:
|
||||
db_entity.status = "completed"
|
||||
db_entity.complated_time = datetime.now()
|
||||
db_entity.completed_time = datetime.now()
|
||||
db_entity.save()
|
||||
|
||||
def make_episode_info(self):
|
||||
|
||||
Reference in New Issue
Block a user