Coming in DASH-DL 0.7.1. Version 1 of this API ships with DASH-DL 0.7.1 for Android. The Android library is not published yet; the plain Intent shown below works without it.
How a request works
DASH-DL never downloads anything silently. Every request — from another app or from a link on a web page — goes through the same steps:
- DASH-DL checks the request (addresses, names, headers, rate limits). A request that fails a check is answered with
refusedand a reason. - On a new install, the person first sees DASH-DL's welcome screen and agrees to the terms, as for every link from outside.
- The download dialog opens (or the batch list, for several links), labelled "Sent by" your app, with your suggested name, folder and start mode. The person can change every suggestion.
- Download or Add to queue answers
acceptedwith a download id; closing the dialog answerscancelled. - DASH-DL steps back so your app is in front again (unless you ask it not to).
The Intent
| Field | Value |
|---|---|
| Action | app.dashdl.action.DOWNLOAD |
| Package | app.dashdl — always set it; the action is not meant for choosers |
| Data | the (first) link: http, https, ftp, ftps or magnet |
| Categories | none needed from apps; browsers add BROWSABLE for intent:// links, and then the web limits below apply |
| Start with | registerForActivityResult(DashDlContract()) or startActivityForResult for an answer, or startActivity |
Extras
All extras are optional and start with app.dashdl.extra..
| Extra | Type | Meaning | Limits | From web pages |
|---|---|---|---|---|
API_VERSION | int | The API version you speak (1) | Newer values are accepted; unknown extras are ignored | yes |
URLS | String[] | All links (data = the first); several open the batch list | Up to 100 links, each up to 8,192 characters; duplicates dropped | yes |
FILE_NAME | String | Suggested file name (one link only) | Path parts, reserved characters and leading dots are removed; up to 200 characters, extension kept | yes |
FOLDER | String | One folder inside DASH-DL's download folder | Letters, digits, space, dot, underscore and hyphen; up to 64 characters; never a path (otherwise ignored) | yes |
REFERER | String | The page the link belongs to; sent as Referer and shown as the source | http(s) only, up to 8,192 characters | yes |
USER_AGENT | String | User-Agent for the download | Up to 512 characters, no line breaks | ignored |
HEADERS | String[] of Name: value | Request headers | Up to 32; values up to 4,096 characters, no line breaks; transport headers, Range, Proxy-* and Cookie are not allowed; use REFERER instead of a Referer header | ignored |
COOKIES | String a=b; c=d | Cookies for the link's site | Up to 8,192 characters, no line breaks | ignored |
START | String now or queue | Which button the dialog suggests | Other values ignored | yes |
OPEN_WHEN_DONE | boolean | Pre-ticks "Open when finished" (one link only) | yes | |
RETURN_TO_CALLER | boolean, default true | After the decision, DASH-DL moves its window back so your app is in front | yes | |
REQUEST_ID | String | Echoed in every answer | Up to 128 characters | yes |
CALLBACK | PendingIntent | Receives every status (below) | Must be created by your app, mutable and explicit | ignored |
Headers and cookies are stored with the download, because the engine needs them to resume it — send only what the server needs.
The answer
The activity result (RESULT_OK for shown or accepted, RESULT_CANCELED for cancelled or refused) and the callback carry these extras, also prefixed app.dashdl.extra.:
| Extra | Meaning |
|---|---|
STATUS | shown, accepted, cancelled, refused; callback only: finished, failed |
REASON | With refused: no_url, invalid_url, unsupported_url, blocked_site, too_many_urls, too_long, bad_header, bad_cookies, bad_referer, rate_limited. With cancelled: replaced (another link took the dialog) |
MESSAGE | One plain English sentence, for your logs |
DOWNLOAD_ID | DASH-DL's opaque id of the download (accepted, finished, failed) |
REQUEST_ID | Your REQUEST_ID |
API_VERSION | The API version DASH-DL speaks |
shownmeans the dialog opened but the person came back to your app first — or a torrent dialog or the batch list opened, whose decisions version 1 does not report. The callback still hears the decision for single links that are not torrents.- No
STATUSat all means Android's own result: DASH-DL was stopped in the meantime, or it is older than 0.7.1. The SDK reportsUNKNOWN. finishedandfailedare sent while DASH-DL is running, up to 24 hours after the add; nothing is sent after a restart.- Nothing else leaves DASH-DL: no file paths, no content URIs, no file data.
What is refused or ignored
- Anything but web, FTP and magnet addresses —
file:,content:,data:,javascript:,intent:,sftp:and others (unsupported_url). To hand DASH-DL a.torrentor playlist file, share it withACTION_SENDorACTION_VIEWand acontent://URI withFLAG_GRANT_READ_URI_PERMISSION. - YouTube and its content hosts, as the link or as the referer (
blocked_site). - DRM-protected streams are accepted for showing, and the dialog then explains that they cannot be downloaded.
- Header, cookie or user-agent injection — line breaks or transport headers (
bad_header,bad_cookies). - More than 5 requests a minute or 30 an hour from one app, or 60 an hour from all apps together (
rate_limited). - Plan limits apply as usual: a Free user adding a 4K stream sees the same Pro note as in the app. The request is not refused; the person decides.
Security
- Consent: the dialog is the consent. Requests from outside wait for the welcome agreement on a new install.
- Caller identity: DASH-DL uses the verified calling package (and, on Android 14 and later, the launching package when your app shares its identity, as the SDK does).
EXTRA_REFERRERis never trusted. Unknown callers show as "another app"; web pages as "a web page". - Callback: used only when the PendingIntent was created by the verified caller; it must be mutable so DASH-DL can fill in the status, and explicit so no other app receives it.
- Paths: names and folders are cleaned to a single path segment inside DASH-DL's download folder.
- Nothing persistent: waiting requests live in memory (at most 20); a restart forgets them.
Android apps
With the library:
val launcher = registerForActivityResult(DashDlContract()) { r -> /* r.status, r.downloadId, r.reason */ }
launcher.launch(DashDlRequest("https://cdn.example.com/movie.mkv", fileName = "movie.mkv"))
Without it, from any language:
val i = Intent("app.dashdl.action.DOWNLOAD", Uri.parse("https://cdn.example.com/movie.mkv"))
.setPackage("app.dashdl")
.putExtra("app.dashdl.extra.API_VERSION", 1)
.putExtra("app.dashdl.extra.FILE_NAME", "movie.mkv")
startActivityForResult(i, 42) // ActivityNotFoundException: DASH-DL missing or older than 0.7.1
Add this to your manifest for Android 11 package visibility:
<queries><package android:name="app.dashdl" /></queries>
To test from a computer:
adb shell am start -a app.dashdl.action.DOWNLOAD -p app.dashdl -d https://example.com/files/test.dat --es app.dashdl.extra.FILE_NAME test.dat
The shell shows as "another app".
Web pages: "Download with DASH-DL"
Use a link, not a script that navigates: browsers follow intent:// addresses only when the visitor taps them, and a page must never try to open one by itself.
intent://cdn.example.com/files/movie.mkv#Intent;scheme=https;action=app.dashdl.action.DOWNLOAD;package=app.dashdl;
S.app.dashdl.extra.FILE_NAME=movie.mkv;i.app.dashdl.extra.API_VERSION=1;
S.browser_fallback_url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dapp.dashdl;end
Write it as one line. For magnets use intent:?xt=urn:btih:…#Intent;scheme=magnet;…. Values are percent-encoded (encodeURIComponent), and the link's own #fragment is dropped. From web pages DASH-DL takes the link, FILE_NAME, FOLDER, REFERER, START and OPEN_WHEN_DONE — never headers, cookies, a user agent or a callback.
The SDK includes a small dependency-free script that turns ordinary links into DASH-DL links on Android only; on computers and iPhones they stay plain links to the file:
<a class="dashdl" href="https://cdn.example.com/files/movie.mkv" data-dashdl-name="movie.mkv">Download with DASH-DL</a>
<script src="/download-with-dashdl.js" defer></script>
Host the script on your own site. On a server, DashDlWeb.link(…) in the library builds the same address.
Chrome, Edge, Samsung Internet, Brave and other Chromium browsers open the link directly, or the fallback page when DASH-DL is not installed; Firefox for Android asks first. The older dashdl://add?url=… deep link still opens the dialog with the link only (no name, folder or fallback) — prefer intent://.
Versioning
- Names on this page never change meaning. New features add extras or statuses and raise
API_VERSION; DASH-DL ignores unknown extras, and the SDK maps unknown statuses toUNKNOWN. - The library has its own semantic version (1.0.0);
DashDl.supportsApi()tells you whether the installed DASH-DL has the API.
Not in version 1
Decisions inside the torrent dialog and the batch list, progress events, a bound service for status queries, and answers to web pages. Each would be a new extra or status and API version 2.