anilife update 2022.10.24(01.)
This commit is contained in:
@@ -102,7 +102,7 @@ class LogicAniLife(LogicModuleBase):
|
|||||||
}
|
}
|
||||||
useragent = {
|
useragent = {
|
||||||
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, "
|
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, "
|
||||||
"like Gecko) Chrome/96.0.4664.110 Whale/3.12.129.46 Safari/537.36"
|
"like Gecko) Chrome/96.0.4664.110 Whale/3.12.129.46 Safari/537.36"
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, P):
|
def __init__(self, P):
|
||||||
@@ -112,7 +112,9 @@ class LogicAniLife(LogicModuleBase):
|
|||||||
default_route_socketio(P, self)
|
default_route_socketio(P, self)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_html(url: str, referer: str = None, stream: bool = False, timeout: int = 5) -> str:
|
def get_html(
|
||||||
|
url: str, referer: str = None, stream: bool = False, timeout: int = 5
|
||||||
|
) -> str:
|
||||||
data = ""
|
data = ""
|
||||||
try:
|
try:
|
||||||
print("cloudflare protection bypass ==================")
|
print("cloudflare protection bypass ==================")
|
||||||
@@ -143,7 +145,9 @@ class LogicAniLife(LogicModuleBase):
|
|||||||
return data
|
return data
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_html_requests(url: str, referer: str = None, stream: str = False, timeout: int = 5) -> str:
|
def get_html_requests(
|
||||||
|
url: str, referer: str = None, stream: str = False, timeout: int = 5
|
||||||
|
) -> str:
|
||||||
data = ""
|
data = ""
|
||||||
try:
|
try:
|
||||||
print("get_html_requests ==================")
|
print("get_html_requests ==================")
|
||||||
@@ -173,7 +177,11 @@ class LogicAniLife(LogicModuleBase):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
async def get_html_playwright(
|
async def get_html_playwright(
|
||||||
url: str, headless: bool = False, referer: str = None, engine: str = "chrome", stealth: bool = False
|
url: str,
|
||||||
|
headless: bool = False,
|
||||||
|
referer: str = None,
|
||||||
|
engine: str = "chrome",
|
||||||
|
stealth: bool = False,
|
||||||
) -> str:
|
) -> str:
|
||||||
try:
|
try:
|
||||||
from playwright.sync_api import sync_playwright
|
from playwright.sync_api import sync_playwright
|
||||||
@@ -338,7 +346,7 @@ class LogicAniLife(LogicModuleBase):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
async def get_vod_url_v1(
|
async def get_vod_url_v1(
|
||||||
url, headless=False, referer=None, engine="chrome", stealth=False
|
url, headless=False, referer=None, engine="chrome", stealth=False
|
||||||
):
|
):
|
||||||
from playwright.sync_api import sync_playwright
|
from playwright.sync_api import sync_playwright
|
||||||
from playwright.async_api import async_playwright
|
from playwright.async_api import async_playwright
|
||||||
@@ -853,7 +861,7 @@ class LogicAniLife(LogicModuleBase):
|
|||||||
|
|
||||||
def setting_save_after(self):
|
def setting_save_after(self):
|
||||||
if self.queue.get_max_ffmpeg_count() != P.ModelSetting.get_int(
|
if self.queue.get_max_ffmpeg_count() != P.ModelSetting.get_int(
|
||||||
"anilife_max_ffmpeg_process_count"
|
"anilife_max_ffmpeg_process_count"
|
||||||
):
|
):
|
||||||
self.queue.set_max_ffmpeg_count(
|
self.queue.set_max_ffmpeg_count(
|
||||||
P.ModelSetting.get_int("anilife_max_ffmpeg_process_count")
|
P.ModelSetting.get_int("anilife_max_ffmpeg_process_count")
|
||||||
@@ -1032,16 +1040,16 @@ class LogicAniLife(LogicModuleBase):
|
|||||||
)
|
)
|
||||||
elif cate == "theater":
|
elif cate == "theater":
|
||||||
url = (
|
url = (
|
||||||
P.ModelSetting.get("anilife_url")
|
P.ModelSetting.get("anilife_url")
|
||||||
+ "/vodtype/categorize/Movie/"
|
+ "/vodtype/categorize/Movie/"
|
||||||
+ page
|
+ page
|
||||||
)
|
)
|
||||||
wrapper_xpath = '//div[@class="bsx"]'
|
wrapper_xpath = '//div[@class="bsx"]'
|
||||||
else:
|
else:
|
||||||
url = (
|
url = (
|
||||||
P.ModelSetting.get("anilife_url")
|
P.ModelSetting.get("anilife_url")
|
||||||
+ "/vodtype/categorize/Movie/"
|
+ "/vodtype/categorize/Movie/"
|
||||||
+ page
|
+ page
|
||||||
)
|
)
|
||||||
# cate == "complete":
|
# cate == "complete":
|
||||||
logger.info("url:::> %s", url)
|
logger.info("url:::> %s", url)
|
||||||
|
|||||||
Reference in New Issue
Block a user