feat(debrid/stremthru): use default url only for specific services

This commit is contained in:
Munif Tanjim
2024-12-29 01:49:36 +06:00
parent 982c398774
commit f0b029d793
2 changed files with 10 additions and 2 deletions
+4 -1
View File
@@ -36,5 +36,8 @@ def prepare_debrid_config(config: dict[str, Any]):
config["debridService"] = settings.PROXY_DEBRID_STREAM_DEBRID_DEFAULT_SERVICE
config["debridApiKey"] = settings.PROXY_DEBRID_STREAM_DEBRID_DEFAULT_APIKEY
if not config["stremthruUrl"]:
if (
not config["stremthruUrl"]
and config["debridService"] in settings.STREMTHRU_AUTO_ENABLED_DEBRID_SERVICES
):
config["stremthruUrl"] = settings.STREMTHRU_DEFAULT_URL
+6 -1
View File
@@ -42,7 +42,12 @@ class AppSettings(BaseSettings):
PROXY_DEBRID_STREAM_DEBRID_DEFAULT_APIKEY: Optional[str] = None
TITLE_MATCH_CHECK: Optional[bool] = True
REMOVE_ADULT_CONTENT: Optional[bool] = False
STREMTHRU_DEFAULT_URL: Optional[str] = None
STREMTHRU_DEFAULT_URL: Optional[str] = "https://stremthru.elfhosted.com"
STREMTHRU_AUTO_ENABLED_DEBRID_SERVICES: List[str] = [
"realdebrid",
"alldebrid",
"debridlink",
]
@field_validator("DASHBOARD_ADMIN_PASSWORD")
def set_dashboard_admin_password(cls, v, values):