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