Add Anilife proxy settings (proxy_url, get_proxy, get_proxies)

This commit is contained in:
2026-01-07 00:30:14 +09:00
parent def2b5b3c5
commit 62dfb2a8b2
3 changed files with 14 additions and 2 deletions

View File

@@ -81,6 +81,7 @@ class LogicAniLife(AnimeModuleBase):
db_default = {
"anilife_db_version": "1",
"anilife_url": "https://anilife.live",
"anilife_proxy_url": "",
"anilife_download_path": os.path.join(path_data, P.package_name, "ohli24"),
"anilife_auto_make_folder": "True",
"anilife_auto_make_season_folder": "True",
@@ -100,6 +101,17 @@ class LogicAniLife(AnimeModuleBase):
"anilife_camoufox_installed": "False",
}
@classmethod
def get_proxy(cls) -> str:
return P.ModelSetting.get("anilife_proxy_url")
@classmethod
def get_proxies(cls) -> Optional[Dict[str, str]]:
proxy = cls.get_proxy()
if proxy:
return {"http": proxy, "https": proxy}
return None
current_headers = None
current_data = None
referer = None