dsh-smart-download: A Smart Multi-threaded Downloader Plugin for DeepSeek Harness
leisureyu/dsh-smart-download
A DSH plugin that bundles aria2 for multi-threaded downloads, probing server capability to pick parallel or curl fallback, with resume support and live progress queries.
dsh-smart-download is a download capability extension for DeepSeek Harness that turns a file transfer into an automatic decision. It first probes whether the target server supports multiple connections, calls the bundled aria2c for concurrent acceleration when it does, and safely falls back to the system curl when it does not or when probing fails, so the file always completes. Beyond multi-threading it offers resume, mirror-prefix acceleration, size-based concurrency tiers, and a queryable progress snapshot, while a protocol allowlist and file-name sanitizing keep untrusted URLs from writing outside the working directory.
How to Install
dsh plugin --profile <your-profile> add @leisureyu/dsh-smart-dlReplace --profile with the profile name you actually run (see ls ~/.dsh/profiles/): usually web in the browser UI, desktop or desktop-NNN in the desktop app.
- Category
- Tools & Capabilities
- Platform
- DSH Plugin
- Author
- leisureyu
- Distribution
- Plugin
dsh-smart-download Key Features
dsh-smart-download Repo Summary
What Does It Do?
It is a smart download DSH plugin for DeepSeek Harness that turns "download a file" into an automatic decision. It solves the pain of slow large-file downloads, servers that refuse multi-connection transfers, and restarts after a dropped connection: before downloading it probes the target server, uses the bundled aria2 for multi-threaded acceleration when supported, and automatically falls back to the system curl when it is not, so the file completes either way. Maintained by LeiSureYu under the MIT license and written in TypeScript, it supports Windows x64 / arm64 and Linux x64 / arm64.
Core Features
- Automatic multi-threaded acceleration: it probes the server first, calls the bundled aria2c for concurrent downloads when multi-connection is supported, and falls back to single-threaded system curl otherwise; any probe failure is safely treated as "no multi-threading" so the download never fails outright.
- Zero configuration: the aria2 binary ships with the plugin, so there is nothing to download or add to PATH.
- Size-based concurrency tiers: files from 1MB to 50MB use 4 connections, files of 50MB and above use 8 connections, and the returned reason distinguishes "no Range support", "file too small", and "aria2 missing".
- Visible and queryable progress: under the web profile a live panel in the lower-right corner shows file name, percentage, speed, and time remaining, then disappears when done; the download_status tool read-only reports percentage, speed, and ETA for the latest task.
- Resume and mirror acceleration: after an interruption, calling again with the same url and output resumes the transfer, and before resuming it compares remote length plus ETag / Last-Modified, re-downloading from scratch when the same source cannot be confirmed; a mirror prefix can be passed for slow overseas resources.
- Safety boundaries: only http and https are allowed, with other schemes such as file: rejected before any probe or download; when no output name is given, the name derived from the URL keeps only a single path segment so nothing is written outside the working directory.
How to Use This Plugin?
After enabling it in DSH, simply have the model call smart_download with a url, optionally passing output to choose the saved file name and mirror to route through a mirror prefix. The result returns success, path, method, size, and fellback, where requestedUrl is the address actually requested and mirrored indicates whether a mirror was used. To check progress, call download_status, which returns percentage, speed, and ETA for the latest task and can answer questions like "how far along is that download?". If a transfer is interrupted, call again with the same url and output to resume. Note that the progress panel only works under the web profile; other profiles keep full functionality and simply rely on download_status for progress.
How to Troubleshoot This Plugin?
- Download succeeds but a ToolOutputError is raised: early versions returned size: undefined when the size could not be probed, which the host rejected as invalid JSON; update to the fixed release as described in the official notes.
- Files written outside the working directory: URL path traversal such as ..%2F..%2F..%2Fescaped.txt could escape in older versions and is now blocked by decoding first, taking only the last segment, and sanitizing.
- Local files copied unexpectedly: the file:// scheme was once accepted by curl and copied local files; it is now rejected by the protocol allowlist before download starts.
- Existing target file yields stale content: aria2 used to save as f.1.bin while the returned path still pointed at the old file, now handled with a uniform overwrite flag.
- Corrupted file after resume: older versions resumed whenever the server supported Range, producing exit code 0 with a wrong file when the remote shrank or changed at equal length; resume now compares remote length and ETag / Last-Modified first.
- Progress panel stuck on "downloading": older progress records lacked a state field and ignored DSH_HOME, writing into a directory nobody read; progress is now written per session and a cancelled state was added.
This page is an independent rewrite of the plugin's official README — for authoritative documentation and the latest changes, refer to the source: leisureyu/dsh-smart-download. The plugin is third-party code that runs on your machine once installed; inclusion does not imply endorsement — please review the source before installing.
DSH Plugin FAQ
