Downloads
- GET /downloads
Return all downloads, both active and inactive
This endpoint returns all downloads in Tribler, both active and inactive. The progress is a number ranging from 0 to 1, indicating the progress of the specific state (downloading, checking etc). The download speeds have the unit bytes/sec. The size of the torrent is given in bytes. The estimated time assumed is given in seconds.
Detailed information about peers and pieces is only requested when the get_peers and/or get_pieces flag is set. Note that setting this flag has a negative impact on performance and should only be used in situations where this data is required.
- Query Parameters
get_peers (boolean) – Flag indicating whether or not to include peers
get_pieces (boolean) – Flag indicating whether or not to include pieces
get_files (boolean) – Flag indicating whether or not to include files
- Status Codes
200 OK –
- Response JSON Object
checkpoints.all_loaded (boolean) –
checkpoints.loaded (integer) –
checkpoints.total (integer) –
downloads.anon_download (boolean) –
downloads.availability (number) –
downloads.destination (string) –
downloads.error (string) –
downloads.eta (integer) –
downloads.files (string) –
downloads.hops (integer) –
downloads.infohash (string) –
downloads.max_download_speed (integer) –
downloads.max_upload_speed (integer) –
downloads.name (string) –
downloads.num_peers (integer) –
downloads.num_seeds (integer) –
downloads.peers (string) –
downloads.progress (number) –
downloads.ratio (number) –
downloads.safe_seeding (boolean) –
downloads.size (integer) –
downloads.speed_down (number) –
downloads.speed_up (number) –
downloads.status (string) –
downloads.status_code (integer) –
downloads.time_added (integer) –
downloads.total_down (integer) –
downloads.total_pieces (integer) –
downloads.total_up (integer) –
downloads.trackers (string) –
downloads.vod_mode (boolean) –
downloads.vod_prebuffering_progress (number) –
downloads.vod_prebuffering_progress_consec (number) –
- PUT /downloads
Start a download from a provided URI.
- Query Parameters
get_peers (boolean) – Flag indicating whether or not to include peers
get_pieces (boolean) – Flag indicating whether or not to include pieces
get_files (boolean) – Flag indicating whether or not to include files
- Request JSON Object
anon_hops (integer) – Number of hops for the anonymous download. No hops is equivalent to a plain download
destination (string) – the download destination path of the torrent
safe_seeding (boolean) – Whether the seeding of the download should be anonymous or not
uri (string) – The URI of the torrent file that should be downloaded. This URI can either represent a file location, a magnet link or a HTTP(S) url. (required)
- Status Codes
200 OK –
- Response JSON Object
infohash (string) –
started (boolean) –
- DELETE /downloads/{infohash}
Remove a specific download.
- Parameters
infohash (string) – Infohash of the download to remove
- Request JSON Object
remove_data (boolean) – Whether or not to remove the associated data
- Status Codes
200 OK –
- Response JSON Object
infohash (string) –
removed (boolean) –
- PATCH /downloads/{infohash}
Update a specific download.
- Parameters
infohash (string) – Infohash of the download to update
- Request JSON Object
anon_hops (integer) – The anonymity of a download can be changed at runtime by passing the anon_hops parameter, however, this must be the only parameter in this request.
selected_files[] (integer) –
state (string) – State parameter to be passed to modify the state of the download (resume/stop/recheck)
- Status Codes
200 OK –
- Response JSON Object
infohash (string) –
modified (boolean) –
- GET /downloads/{infohash}/files
Return file information of a specific download.
- Parameters
infohash (string) – Infohash of the download to from which to get file information
- Status Codes
200 OK –
- Response JSON Object
files[].included (boolean) –
files[].index (integer) –
files[].name (string) –
files[].progress (number) –
files[].size (integer) –
- GET /downloads/{infohash}/stream/{fileindex}
Stream the contents of a file that is being downloaded.
- Parameters
infohash (string) – Infohash of the download to stream
fileindex (string) – The fileindex to stream
- Status Codes
206 Partial Content – Contents of the stream