diff --git a/cmdlet/download_file.py b/cmdlet/download_file.py index 52daaa5..c9e200e 100644 --- a/cmdlet/download_file.py +++ b/cmdlet/download_file.py @@ -3943,18 +3943,10 @@ class Download_File(Cmdlet): # Priority 2: Config default output/temp directory, then OS temp try: from SYS.config import resolve_output_dir - final_output_dir = resolve_output_dir(config) except Exception: - final_output_dir = None - - # If config resolution failed, use OS temp directory - if not final_output_dir: - try: - import tempfile - final_output_dir = Path(tempfile.gettempdir()) / "Medios-Macina" - except Exception: - final_output_dir = Path.home() / ".Medios-Macina-temp" + import tempfile + final_output_dir = Path(tempfile.gettempdir()) / "Medios-Macina" debug(f"Using default directory: {final_output_dir}") diff --git a/docs/img/MM.png b/docs/img/MM.png new file mode 100644 index 0000000..bb6acef Binary files /dev/null and b/docs/img/MM.png differ diff --git a/readme.md b/readme.md index a22efcb..b724881 100644 --- a/readme.md +++ b/readme.md @@ -1,3 +1,7 @@ + +![PowerShell Gallery Downloads](docs\img\MM.png) + + # Medeia-Macina Medios-Macina is a CLI media manager and toolkit focused on downloading, tagging, and media storage (audio, video, images, and text) from a variety of providers and sources. It is designed around a compact, pipeable command language ("cmdlets") so complex workflows can be composed simply and repeatably. diff --git a/scripts/README.md b/scripts/README.md deleted file mode 100644 index d2d421a..0000000 --- a/scripts/README.md +++ /dev/null @@ -1,60 +0,0 @@ -Playwright fetch helper - -This helper uses Playwright to drive a browser to click the download button on a Vimm detail page and save the resulting file to disk. - -Usage examples - -Programmatic usage - -- Basic example (Python): - - ```py - from tool.playwright import PlaywrightTool - - tool = PlaywrightTool({}) - result = tool.download_file("https://vimm.net/vault/48075", selector="form#dl_form button[type=submit]", out_dir=None, timeout_sec=60) - if result.ok: - print(result.path) - else: - print("Download failed:", result.error) - ``` - -- Shell one-liners (PowerShell / Unix compatible): - - - PowerShell: - - ```powershell - python - <<'PY' - from tool.playwright import PlaywrightTool - r = PlaywrightTool().download_file("https://vimm.net/vault/48075") - print(r.to_dict()) - PY - ``` - - - Unix shell: - - ```sh - python -c "from tool.playwright import PlaywrightTool; import json; r=PlaywrightTool().download_file('https://vimm.net/vault/48075'); print(json.dumps(r.to_dict()))" - ``` - -- Download to a specific directory: - - ```py - tool.download_file("https://vimm.net/vault/48075", out_dir="C:\\tmp") - ``` - -- Pipe the result into `add-file`: - - Use one of the shell one-liners above and extract the `path` field from the returned JSON to pass to `CLI.py add-file`. For example, in Unix: - - ```sh - python -c "from tool.playwright import PlaywrightTool, json; r=PlaywrightTool().download_file('https://vimm.net/vault/48075'); print(r.to_dict())" | jq -r .path | xargs -I{} python CLI.py add-file -store default -path "{}" - ``` - -Notes - -- The script prints a single JSON line to stdout on completion. On success, `ok` is true and `path` contains the saved file path. -- Provider `Provider.vimm` will use Playwright when HTTP GET fails (4xx/5xx) or on network errors. Playwright is a required runtime dependency for these flows. - - -- Playwright must be available in the current Python environment; install with `pip install playwright && playwright install`.