This commit is contained in:
2026-02-14 20:39:33 -08:00
parent ae4880b164
commit 14871a1f02
3 changed files with 63 additions and 10 deletions

View File

@@ -1203,11 +1203,29 @@ class AllDebrid(TableProviderMixin, Provider):
log(f"AllDebrid magnet {magnet_id} has no files", file=sys.stderr)
return 0
file_entries = list(self._flatten_files(file_nodes))
total_files = len(file_entries)
if total_files <= 0:
log(f"AllDebrid magnet {magnet_id} has no downloadable files", file=sys.stderr)
return 0
try:
if progress is not None and hasattr(progress, "begin_steps"):
progress.begin_steps(total_files)
except Exception:
pass
downloaded = 0
for node in self._flatten_files(file_nodes):
for file_idx, node in enumerate(file_entries, 1):
locked_url = str(node.get("l") or node.get("link") or "").strip()
file_name = str(node.get("n") or node.get("name") or "").strip()
relpath = str(node.get("_relpath") or file_name or "").strip()
try:
if progress is not None and hasattr(progress, "step"):
progress.step(f"file {file_idx}/{total_files}: {relpath or file_name or 'download'}")
except Exception:
pass
if not locked_url or not relpath:
continue