DocsDownload Managementhttp_download

http_download

Http Download

Download a file from an HTTP/HTTPS URL and save it to disk. Supports resume for interrupted downloads, custom output paths, proxy configuration, and Tor anonymization. If no output path is specified, the file is saved to /tmp/owl_downloads/ with a filename derived from the URL or Content-Disposition header. Returns the file path, size, content type, and download timing.

Usage Example

1234567891011
import asyncio
from owl_browser import OwlBrowser, RemoteConfig
# Async usage
async with OwlBrowser(config) as browser:
context = await browser.create_context()
context_id = context["context_id"]
await browser.http_download(
url="https://example.com"
)

Parameters

Required

urlstringrequired

The URL of the file to download. Supports http:// and https:// protocols.

Optional

output_pathstring

Full path where the file should be saved. If not specified, saves to /tmp/owl_downloads/ with filename derived from URL or Content-Disposition header.

headersstring

HTTP headers as a JSON object or string.

cookiesstring

Cookies to send with the request. Accepts 'name=value; name2=value2' string or a JSON array from browser_get_cookies.

proxy_typeenum
httphttpssocks4socks5+1 more

Type of proxy server.

proxy_hoststring

Proxy server hostname or IP address.

proxy_portstring

Proxy server port number.

proxy_usernamestring

Username for proxy authentication.

proxy_passwordstring

Password for proxy authentication.

use_torboolean

Use built-in Tor proxy for anonymous download. Default: false

timeoutstring

Download timeout in milliseconds. Default: 30000 (30 seconds)

ssl_verifyboolean

Verify SSL/TLS certificates. Default: true

ca_cert_pathstring

Path to custom CA certificate bundle file.

resumeboolean

Resume an interrupted download if the server supports byte ranges. Default: false

user_agentstring

Custom User-Agent header string.

Response

Returns a JSON object with the operation result.

{
  "success": true,
  "result": <value>
}