f
This commit is contained in:
@@ -401,22 +401,11 @@ class Download_File(Cmdlet):
|
||||
|
||||
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:
|
||||
# Some providers might work via callback 'download_items', mostly legacy.
|
||||
# If relevant, check for it.
|
||||
download_items = getattr(provider_obj, "download_items", None)
|
||||
if callable(download_items):
|
||||
pass # We can implement generic callback support if needed,
|
||||
# but pure download() is preferred.
|
||||
|
||||
# Fallback: if we have a direct HTTP URL, download it directly
|
||||
if (downloaded_path is None and isinstance(target,
|
||||
str)
|
||||
and target.startswith("http")):
|
||||
|
||||
# Generic guard for known "not-a-file" URLs could go here or in a helper,
|
||||
# but for now we rely on user or provider.
|
||||
# Fallback: if we have a direct HTTP URL and no provider successfully handled it
|
||||
if (downloaded_path is None and not attempted_provider_download
|
||||
and isinstance(target, str) and target.startswith("http")):
|
||||
|
||||
debug(
|
||||
f"[download-file] Provider item looks like direct URL, downloading: {target}"
|
||||
|
||||
Reference in New Issue
Block a user