This commit is contained in:
2026-01-31 23:22:30 -08:00
parent ed44d69ef1
commit 753cdfb196
6 changed files with 454 additions and 35 deletions

View File

@@ -554,6 +554,7 @@ class Download_File(Cmdlet):
dict) else None,
progress=progress,
config=config,
provider_hint=provider_key
)
downloaded_count += 1
@@ -2594,7 +2595,14 @@ class Download_File(Cmdlet):
parsed = parse_cmdlet_args(args, self)
# Resolve URLs from -url or positional arguments
url_candidates = parsed.get("url") or [a for a in parsed.get("args", []) if isinstance(a, str) and (a.startswith("http") or "://" in a)]
url_candidates = parsed.get("url") or [
a for a in parsed.get("args", [])
if isinstance(a, str) and (
a.startswith("http") or "://" in a or ":" in a
or "🧲" in a
and not a.startswith("-")
)
]
raw_url = normalize_url_list(url_candidates)
quiet_mode = bool(config.get("_quiet_background_output")) if isinstance(config, dict) else False
@@ -2618,7 +2626,7 @@ class Download_File(Cmdlet):
s_val = str(value or "").strip().lower()
except Exception:
return False
return s_val.startswith(("http://", "https://"))
return s_val.startswith(("http://", "https://", "magnet:", "torrent:", "alldebrid:", "alldebrid🧲"))
def _extract_selection_args(item: Any) -> tuple[Optional[List[str]], Optional[str]]:
selection_args: Optional[List[str]] = None
@@ -2786,9 +2794,15 @@ class Download_File(Cmdlet):
and (not parsed.get("path")) and (not parsed.get("output"))):
candidate = str(raw_url[0] or "").strip()
low = candidate.lower()
looks_like_url = low.startswith(("http://", "https://", "ftp://"))
looks_like_url = low.startswith((
"http://", "https://", "ftp://", "magnet:", "torrent:",
"alldebrid:", "alldebrid🧲"
))
looks_like_provider = (
":" in candidate and not candidate.startswith(("http:", "https:", "ftp:", "ftps:", "file:"))
":" in candidate and not candidate.startswith((
"http:", "https:", "ftp:", "ftps:", "file:",
"alldebrid:"
))
)
looks_like_windows_path = (
(len(candidate) >= 2 and candidate[1] == ":")