update alldebrid plugin

This commit is contained in:
2026-05-23 14:20:12 -07:00
parent a8cdd09e1e
commit 6c0a1b4415
3 changed files with 146 additions and 142 deletions
+16 -1
View File
@@ -1460,6 +1460,8 @@ class Download_File(Cmdlet):
) -> List[Dict[str, Any]]:
if not canonical_url:
return []
if not cls._supports_storage_duplicate_lookup(canonical_url):
return []
config_dict = config if isinstance(config, dict) else {}
refs: List[Dict[str, Any]] = []
@@ -1691,6 +1693,20 @@ class Download_File(Cmdlet):
return storage, hydrus_available
@staticmethod
def _supports_storage_duplicate_lookup(raw_url: str) -> bool:
text = str(raw_url or "").strip()
if not text:
return False
try:
parsed = urlparse(text)
except Exception:
parsed = None
scheme = str(getattr(parsed, "scheme", "") or "").strip().lower()
return scheme in {"http", "https", "ftp", "ftps"}
@staticmethod
def _filter_supported_urls(raw_urls: Sequence[str]) -> tuple[List[str], List[str]]:
"""Split explicit URLs into supported and unsupported buckets."""
@@ -2690,7 +2706,6 @@ class Download_File(Cmdlet):
self._maybe_render_download_details(config=config)
return 0
log("No downloads completed", file=sys.stderr)
return 1
except Exception as e: