DASH-DL Get the app

Developers

DASH-DL developer API and SDK

Hand links to DASH-DL from your Android app or your web page. Every request opens DASH-DL's download dialog; nothing downloads until the person taps Download.

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:

  1. DASH-DL checks the request (addresses, names, headers, rate limits). A request that fails a check is answered with refused and a reason.
  2. On a new install, the person first sees DASH-DL's welcome screen and agrees to the terms, as for every link from outside.
  3. 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.
  4. Download or Add to queue answers accepted with a download id; closing the dialog answers cancelled.
  5. DASH-DL steps back so your app is in front again (unless you ask it not to).

The Intent

FieldValue
Actionapp.dashdl.action.DOWNLOAD
Packageapp.dashdl — always set it; the action is not meant for choosers
Datathe (first) link: http, https, ftp, ftps or magnet
Categoriesnone needed from apps; browsers add BROWSABLE for intent:// links, and then the web limits below apply
Start withregisterForActivityResult(DashDlContract()) or startActivityForResult for an answer, or startActivity

Extras

All extras are optional and start with app.dashdl.extra..

ExtraTypeMeaningLimitsFrom web pages
API_VERSIONintThe API version you speak (1)Newer values are accepted; unknown extras are ignoredyes
URLSString[]All links (data = the first); several open the batch listUp to 100 links, each up to 8,192 characters; duplicates droppedyes
FILE_NAMEStringSuggested file name (one link only)Path parts, reserved characters and leading dots are removed; up to 200 characters, extension keptyes
FOLDERStringOne folder inside DASH-DL's download folderLetters, digits, space, dot, underscore and hyphen; up to 64 characters; never a path (otherwise ignored)yes
REFERERStringThe page the link belongs to; sent as Referer and shown as the sourcehttp(s) only, up to 8,192 charactersyes
USER_AGENTStringUser-Agent for the downloadUp to 512 characters, no line breaksignored
HEADERSString[] of Name: valueRequest headersUp 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 headerignored
COOKIESString a=b; c=dCookies for the link's siteUp to 8,192 characters, no line breaksignored
STARTString now or queueWhich button the dialog suggestsOther values ignoredyes
OPEN_WHEN_DONEbooleanPre-ticks "Open when finished" (one link only)yes
RETURN_TO_CALLERboolean, default trueAfter the decision, DASH-DL moves its window back so your app is in frontyes
REQUEST_IDStringEchoed in every answerUp to 128 charactersyes
CALLBACKPendingIntentReceives every status (below)Must be created by your app, mutable and explicitignored

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.:

ExtraMeaning
STATUSshown, accepted, cancelled, refused; callback only: finished, failed
REASONWith 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)
MESSAGEOne plain English sentence, for your logs
DOWNLOAD_IDDASH-DL's opaque id of the download (accepted, finished, failed)
REQUEST_IDYour REQUEST_ID
API_VERSIONThe API version DASH-DL speaks
  • shown means 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 STATUS at all means Android's own result: DASH-DL was stopped in the meantime, or it is older than 0.7.1. The SDK reports UNKNOWN.
  • finished and failed are 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 .torrent or playlist file, share it with ACTION_SEND or ACTION_VIEW and a content:// URI with FLAG_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_REFERRER is 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 to UNKNOWN.
  • 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.