update and cleanup repo
This commit is contained in:
@@ -1027,7 +1027,7 @@ def unlock_link_cmdlet(result: Any, args: Sequence[str], config: Dict[str, Any])
|
||||
unlock-link # Uses URL from pipeline result
|
||||
|
||||
Requires:
|
||||
- AllDebrid API key in config under Debrid.All-debrid
|
||||
- AllDebrid API key in config under plugin.alldebrid.api_key
|
||||
|
||||
Args:
|
||||
result: Pipeline result object
|
||||
@@ -1054,28 +1054,14 @@ def unlock_link_cmdlet(result: Any, args: Sequence[str], config: Dict[str, Any])
|
||||
return None
|
||||
|
||||
def _get_alldebrid_api_key_from_config(cfg: Dict[str, Any]) -> Optional[str]:
|
||||
# Current config format
|
||||
try:
|
||||
provider_cfg = cfg.get("provider") if isinstance(cfg, dict) else None
|
||||
ad_cfg = provider_cfg.get("alldebrid"
|
||||
) if isinstance(provider_cfg,
|
||||
dict) else None
|
||||
api_key = ad_cfg.get("api_key") if isinstance(ad_cfg, dict) else None
|
||||
if isinstance(api_key, str) and api_key.strip():
|
||||
return api_key.strip()
|
||||
except Exception:
|
||||
pass
|
||||
from SYS.config import get_debrid_api_key
|
||||
|
||||
# Legacy config format fallback (best-effort)
|
||||
try:
|
||||
debrid_cfg = cfg.get("Debrid") if isinstance(cfg, dict) else None
|
||||
api_key = None
|
||||
if isinstance(debrid_cfg, dict):
|
||||
api_key = debrid_cfg.get("All-debrid") or debrid_cfg.get("AllDebrid")
|
||||
api_key = get_debrid_api_key(cfg, service="All-debrid")
|
||||
if isinstance(api_key, str) and api_key.strip():
|
||||
return api_key.strip()
|
||||
except Exception:
|
||||
pass
|
||||
return None
|
||||
|
||||
return None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user