interface DownloadRequest

One resource to fetch, as part of DownloadResult.downloads — see that field's own docs. specs/005-download-plugin-progress/contracts/plugin-download-protocol.md is the wire contract this mirrors field-for-field.

Properties

url: string

The real, directly-fetchable resource URL.

optional
method: string

Defaults to "GET" when absent — every real corpus plugin (and legacy LANraragi's own Model::Upload.pm::download_url) only ever uses GET, but other methods remain representable for a future plugin that needs one.

optional
headers: Record<string, string>

Extra request headers for this specific resource (e.g. Pixiv's anti-hotlink Referer header) — absent means no extra headers beyond whatever the host's own downloader sends by default.

optional
filename_hint: string

A plugin-suggested filename, used only as a fallback when the real HTTP response has no (or an unparseable) Content-Disposition header.

Usage

import { type DownloadRequest } from "crates/lanrurugi-plugin/dispatcher/plugin-sdk.ts";