2022.01.31 linkkf 버그 픽스 (.05. 기타)

This commit is contained in:
2023-01-31 22:46:52 +09:00
parent 0e45dc8de7
commit e37a3c652b
3 changed files with 297 additions and 22 deletions

View File

@@ -574,8 +574,6 @@ class LogicAniLife(LogicModuleBase):
# page.reload()
# time.sleep(10)
# cookies = context.cookies
# print(cookies)
# print(page.content())
# vod_url = page.evaluate(
@@ -588,28 +586,11 @@ class LogicAniLife(LogicModuleBase):
# return _0x55265f(0x99) + alJson[_0x55265f(0x91)]
# }"""
# )
result_har_json = har.to_json()
result_har_dict = har.to_dict()
# logger.debug(result_har_dict)
# result_har_json = har.to_json()
tmp_video_url = []
for i, elem in enumerate(result_har_dict["log"]["entries"]):
# if "m3u8" in elem["request"]["url"]:
if "m3u8" in elem["request"]["url"]:
logger.debug(elem["request"]["url"])
tmp_video_url.append(elem["request"]["url"])
await context.close()
await browser.close()
logger.debug(tmp_video_url)
vod_url = tmp_video_url[-1]
for i, el in enumerate(tmp_video_url):
if el.endswith("m3u8"):
vod_url = el
logger.debug(f"vod_url:: {vod_url}")
logger.debug(f"run at {time.time() - start} sec")
return vod_url
except Exception as e:
logger.error("Exception:%s", e)
result = subprocess.run(
@@ -618,9 +599,32 @@ class LogicAniLife(LogicModuleBase):
print(result.stdout)
logger.error(traceback.format_exc())
finally:
await browser.close()
result_har_dict = har.to_dict()
# logger.debug(result_har_dict)
tmp_video_url = []
for i, elem in enumerate(result_har_dict["log"]["entries"]):
# if "m3u8" in elem["request"]["url"]:
if "m3u8" in elem["request"]["url"]:
logger.debug(elem["request"]["url"])
tmp_video_url.append(elem["request"]["url"])
logger.debug(tmp_video_url)
vod_url = tmp_video_url[-1]
for i, el in enumerate(tmp_video_url):
if el.endswith("m3u8"):
vod_url = el
logger.debug(f"vod_url:: {vod_url}")
logger.debug(f"run at {time.time() - start} sec")
return vod_url
@staticmethod
@yommi_timeit
def get_html_selenium(