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
infohash (str) – If specified only return the download with the given infohash
excluded (str) – If specified, only return downloads excluding this one
- Status Codes:
200 OK –
- Response JSON Object:
checkpoints.all_loaded (boolean) –
checkpoints.loaded (integer) –
checkpoints.total (integer) –
downloads.all_time_download (integer) –
downloads.all_time_ratio (number) –
downloads.all_time_upload (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.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_pieces (integer) –
downloads.trackers (string) –
- 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
- Query Parameters:
view_start_path (string) – Path of the file or directory to form a view for
view_size (number) – Number of files to include in the view
- 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}/files/collapse
Collapse a tree directory.
- Parameters:
infohash (string) – Infohash of the download
- Query Parameters:
path (string) – Path of the directory to collapse
- Status Codes:
200 OK –
- GET /downloads/{infohash}/files/deselect
Deselect a tree path.
- Parameters:
infohash (string) – Infohash of the download
- Query Parameters:
path (string) – Path of the directory to deselect
- Status Codes:
200 OK –
- GET /downloads/{infohash}/files/expand
Expand a tree directory.
- Parameters:
infohash (string) – Infohash of the download
- Query Parameters:
path (string) – Path of the directory to expand
- Status Codes:
200 OK –
- Response JSON Object:
path (string) –