h
This commit is contained in:
@@ -452,45 +452,44 @@ class Download_File(Cmdlet):
|
||||
if provider_obj is not None:
|
||||
attempted_provider_download = True
|
||||
sr = SearchResult(
|
||||
table=str(table),
|
||||
title=str(title or "Unknown"),
|
||||
path=str(target or ""),
|
||||
tag=set(tags_list) if tags_list else set(),
|
||||
media_kind=str(media_kind or "file"),
|
||||
full_metadata=full_metadata
|
||||
if isinstance(full_metadata,
|
||||
dict) else {},
|
||||
)
|
||||
debug(
|
||||
f"[download-file] Downloading provider item via {table}: {sr.title}"
|
||||
)
|
||||
table=str(table),
|
||||
title=str(title or "Unknown"),
|
||||
path=str(target or ""),
|
||||
tag=set(tags_list) if tags_list else set(),
|
||||
media_kind=str(media_kind or "file"),
|
||||
full_metadata=full_metadata
|
||||
if isinstance(full_metadata, dict) else {},
|
||||
)
|
||||
debug(
|
||||
f"[download-file] Downloading provider item via {table}: {sr.title}"
|
||||
)
|
||||
|
||||
# Preserve provider structure when possible (AllDebrid folders -> subfolders).
|
||||
output_dir = final_output_dir
|
||||
# Generic: allow provider to strict output_dir?
|
||||
# Using default output_dir for now.
|
||||
|
||||
downloaded_path = provider_obj.download(sr, output_dir)
|
||||
provider_sr = sr
|
||||
debug(f"[download-file] Provider download result: {downloaded_path}")
|
||||
# Preserve provider structure when possible (AllDebrid folders -> subfolders).
|
||||
output_dir = final_output_dir
|
||||
# Generic: allow provider to strict output_dir?
|
||||
# Using default output_dir for now.
|
||||
|
||||
downloaded_path = provider_obj.download(sr, output_dir)
|
||||
provider_sr = sr
|
||||
debug(f"[download-file] Provider download result: {downloaded_path}")
|
||||
|
||||
if downloaded_path is None:
|
||||
try:
|
||||
downloaded_extra = self._download_provider_items(
|
||||
provider=provider_obj,
|
||||
provider_name=str(provider_key),
|
||||
search_result=sr,
|
||||
output_dir=output_dir,
|
||||
progress=progress,
|
||||
quiet_mode=quiet_mode,
|
||||
config=config,
|
||||
)
|
||||
except Exception:
|
||||
downloaded_extra = 0
|
||||
if downloaded_path is None:
|
||||
try:
|
||||
downloaded_extra = self._download_provider_items(
|
||||
provider=provider_obj,
|
||||
provider_name=str(provider_key),
|
||||
search_result=sr,
|
||||
output_dir=output_dir,
|
||||
progress=progress,
|
||||
quiet_mode=quiet_mode,
|
||||
config=config,
|
||||
)
|
||||
except Exception:
|
||||
downloaded_extra = 0
|
||||
|
||||
if downloaded_extra:
|
||||
downloaded_count += int(downloaded_extra)
|
||||
continue
|
||||
if downloaded_extra:
|
||||
downloaded_count += int(downloaded_extra)
|
||||
continue
|
||||
|
||||
# Fallback: if we have a direct HTTP URL and no provider successfully handled it
|
||||
if (downloaded_path is None and not attempted_provider_download
|
||||
|
||||
Reference in New Issue
Block a user