This commit is contained in:
2026-01-10 19:56:19 -08:00
parent c2edd5139f
commit 72de1cec68
4 changed files with 6 additions and 70 deletions

View File

@@ -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"
debug(f"Using default directory: {final_output_dir}")

BIN
docs/img/MM.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@@ -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.

View File

@@ -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`.