Vai al contenuto principale
E

dsh-download-router

elgwia-dsh/dsh-download-router

Routes every download across seven transports (node, python, curl, wget, aria2c, PowerShell, BITS) plus mirror variants, picks the fastest route against a baseline measured at setup, and exposes download, download_status and download_baseline tools.

Installazione

dsh plugin --profile web add github:elgwia-dsh/dsh-download-router

README

dsh-download-router

English · 简体中文

DeepSeek Harness adapter: exposes the multi-route download scheduler from download-router as three tools.

The engine is not here — this package only registers tools, translates arguments, spawns the CLI and reads its result back. That keeps it thin, so upgrading DSH never means re-implementing the scheduler.

Tools

ToolPurpose
download{ url, dest?, sha256?, timeoutMs?, mode?, special?, refreshBaseline? }
download_statusCurrent mode, proxy, backend availability, baselines, route table
download_baselineRe-measure baselines (after switching networks or toggling the proxy)

Install from the plugin market

In DSH → Settings → Plugin market → add this index:

https://raw.githubusercontent.com/Elgwia-dsh/dsh-download-router/main/market/index.json

Then install dsh-download-router from the Discover tab. The package manager pulls its dependency download-router from GitHub automatically.

Install

This package depends on download-router. Two options:

A. npm (once published)

npm i -g dsh-download-router

B. Side-by-side clone

plugins/
  download-router/        # core
  dsh-download-router/    # this package

CLI resolution order: DL_ROUTER_CLI env var → node_modules/download-router → sibling ../download-router.

Then add the package to your profile:

// profile package.json
"dependencies": { "dsh-download-router": "link:/path/to/dsh-download-router" },
"dsh": { "profile": { "bundles": ["...", "dsh-download-router"] } }
pnpm install

The first load needs a host restart (or disable → enable in the plugin panel).

Configuration

The bundled cordis.patch.yml contains generic defaults only; machine-specific paths (download directory, proxy core, subscription file) belong in the profile patch:

- id: download-router
  name: 'dsh-download-router'
  config:
    destDir: '~/Downloads'
    dataDir: '~/.download-router'
    proxy:
      url: 'http://127.0.0.1:7890'
      exe: '/path/to/mihomo'
      configDir: '~/.config/clash'

These values are written to a temporary JSON and handed to the CLI, so the core package's own config file is never touched.

Requirements

  • Node >= 18
  • At least one working backend (node built-in is enough)
  • python / curl / wget / aria2c / yt-dlp / git are all optional

Known limits

  • Under a reduced-privilege sandbox, curl / IWR / BITS stay unavailable (the system TLS stack cannot acquire credentials).
  • Multi-connection sharding is off by default.
  • Tool results are handed over through temporary files, so the data directory must be writable (the core falls back when it is not).

License

MIT

Plugin correlati