update and cleanup repo
This commit is contained in:
+9
-10
@@ -19,7 +19,7 @@ import shutil
|
||||
import webbrowser
|
||||
|
||||
|
||||
from API.HTTP import _download_direct_file
|
||||
from API.HTTP import download_direct_file
|
||||
from SYS.models import DownloadError, DownloadOptions, DownloadMediaResult
|
||||
from SYS.logger import log, debug_panel, is_debug_enabled
|
||||
from SYS.payload_builders import build_file_result_payload, build_table_result_payload
|
||||
@@ -235,7 +235,7 @@ class Download_File(Cmdlet):
|
||||
|
||||
action = str(
|
||||
result.get("action")
|
||||
or result.get("provider_action")
|
||||
or result.get("plugin_action")
|
||||
or ""
|
||||
).strip().lower()
|
||||
|
||||
@@ -338,12 +338,12 @@ class Download_File(Cmdlet):
|
||||
path_value: Optional[Any] = path
|
||||
|
||||
if isinstance(path, dict):
|
||||
provider_action = str(
|
||||
plugin_action = str(
|
||||
path.get("action")
|
||||
or path.get("provider_action")
|
||||
or path.get("plugin_action")
|
||||
or ""
|
||||
).strip().lower()
|
||||
if provider_action == "download_items" or bool(path.get("download_items")):
|
||||
if plugin_action == "download_items" or bool(path.get("download_items")):
|
||||
request_metadata = path.get("metadata") or path.get("full_metadata") or {}
|
||||
if not isinstance(request_metadata, dict):
|
||||
request_metadata = {}
|
||||
@@ -522,7 +522,7 @@ class Download_File(Cmdlet):
|
||||
|
||||
# Direct Download Fallback
|
||||
attempted_download = True
|
||||
result_obj = _download_direct_file(
|
||||
result_obj = download_direct_file(
|
||||
str(url),
|
||||
final_output_dir,
|
||||
quiet=quiet_mode,
|
||||
@@ -569,7 +569,7 @@ class Download_File(Cmdlet):
|
||||
key = self._normalize_provider_key(table_hint)
|
||||
if key:
|
||||
return key
|
||||
provider_hint = get_field(item, "provider")
|
||||
provider_hint = get_field(item, "plugin")
|
||||
key = self._normalize_provider_key(provider_hint)
|
||||
if key:
|
||||
return key
|
||||
@@ -743,7 +743,7 @@ class Download_File(Cmdlet):
|
||||
and isinstance(target, str) and target.startswith("http")):
|
||||
|
||||
suggested_name = str(title).strip() if title is not None else None
|
||||
result_obj = _download_direct_file(
|
||||
result_obj = download_direct_file(
|
||||
target,
|
||||
final_output_dir,
|
||||
quiet=quiet_mode,
|
||||
@@ -926,7 +926,6 @@ class Download_File(Cmdlet):
|
||||
}
|
||||
if provider_hint:
|
||||
payload["plugin"] = str(provider_hint)
|
||||
payload["provider"] = str(provider_hint)
|
||||
if full_metadata:
|
||||
payload["metadata"] = full_metadata
|
||||
if notes:
|
||||
@@ -1125,7 +1124,7 @@ class Download_File(Cmdlet):
|
||||
filename += ext_text
|
||||
|
||||
if download_url:
|
||||
result_obj = _download_direct_file(
|
||||
result_obj = download_direct_file(
|
||||
download_url,
|
||||
final_output_dir,
|
||||
quiet=True,
|
||||
|
||||
Reference in New Issue
Block a user