Transfers

Transfer methods are associated with transmission of a file to user computer.

JSON Template

Fields of a transfer object are as follows:

"transfer": {
    "availability": null,
    "callback_url": null,
    "created_at": "2013-09-11T07:46:16",
    "current_ratio": 0.00,
    "down_speed": 0,
    "downloaded": 0,
    "error_message": null,
    "estimated_time": null,
    "extract": false,
    "file_id": null,
    "finished_at": null,
    "id": 9774835,
    "is_private": false,
    "name": "TedVideo",
    "peers_connected": 0,
    "peers_getting_from_us": 0,
    "peers_sending_to_us": 0,
    "percent_done": 0,
    "save_parent_id": 0,
    "seconds_seeding": 0,
    "size": 32810896,
    "source": null,
    "status": "IN_QUEUE",
    "status_message": "In queue...",
    "subscription_id": null,
    "tracker_message": null,
    "type": "TORRENT",
    "up_speed": 0,
    "uploaded": 0
}

Methods

List

GET /transfers/list

Lists active transfers. If transfer is completed, it is removed from the list.

Example response:

{
  "status": "OK",
  "transfers": [
          {
              "uploaded": 0,
              "estimated_time": 5,
              "peers_getting_from_us": 0,
              "extract": false,
              "current_ratio": 0.00,
              "size": 9409268,
              "up_speed": 0,
              "id": 2293761,
              "source": "magnet:?xt=urn:btih:194a4c341487fd12d36718054c1e8fef4358b2ab3",
              "subscription_id": null,
              "status_message": "\u2193 1.2 MB/s, \u2191 0.0 bytes/s | connected to 36 peers, sending to 0 peers | dl: 2.9 MB / 9.0 MB, ul: 0.0 bytes",
              "status": "DOWNLOADING",
              "down_speed": 1249337,
              "peers_connected": 36,
              "downloaded": 2999431,
              "file_id": null,
              "peers_sending_to_us": 22,
              "percent_done": 30,
              "tracker_message": null,
              "name": "A video",
              "created_at": "2012-03-28T09:14:17",
              "error_message": null,
              "save_parent_id": 0
          },
          {
              "uploaded": 0,
              "estimated_time": null,
              "peers_getting_from_us": 0,
              "extract": false,
              "current_ratio": 0.00,
              "size": null,
              "up_speed": 0,
              "is_seeding": false,
              "id": 63,
              "subscription_id": null,
              "status_message": "In queue",
              "status": "IN_QUEUE",
              "down_speed": 0,
              "peers_connected": 0,
              "downloaded": 0,
              "file_id": null,
              "peers_sending_to_us": 0,
              "percent_done": 0,
              "tracker_message": null,
              "name": "Another video",
              "created_at": "2012-03-23T05:56:30",
              "error_message": null,
              "save_parent_id": 46
          }
      ]
}

Add

POST /transfers/add

Adds a new transfer.

Parameters

url:Location of the file to be downloaded.
save_parent_id:Save location of the transfer. This defaults to 0 (which means root).
callback_url:We POST the transfer’s metadata to this URL after the download is finished. (optional)

Example response:

{
    "uploaded": 0,
    "estimated_time": 5,
    "peers_getting_from_us": 0,
    "extract": false,
    "current_ratio": 0.00,
    "size": 9409268,
    "up_speed": 0,
    "id": 2293761,
    "source": "magnet:?xt=urn:btih:194a4c341487fd12d36718054c1e8fef4358b2ab3",
    "subscription_id": null,
    "status_message": "\u2193 1.2 MB/s, \u2191 0.0 bytes/s | connected to 36 peers, sending to 0 peers | dl: 2.9 MB / 9.0 MB, ul: 0.0 bytes",
    "status": "DOWNLOADING",
    "down_speed": 1249337,
    "peers_connected": 36,
    "downloaded": 2999431,
    "file_id": null,
    "peers_sending_to_us": 22,
    "percent_done": 30,
    "tracker_message": null,
    "name": "A video",
    "created_at": "2012-03-28T09:14:17",
    "error_message": null,
    "save_parent_id": 0
}

Get

GET /transfers/<id>

Returns a transfer’s properties.

Example response:

{
    "uploaded": 0,
    "estimated_time": 5,
    "peers_getting_from_us": 0,
    "extract": false,
    "current_ratio": 0.00,
    "size": 9409268,
    "up_speed": 0,
    "id": 2293761,
    "source": "magnet:?xt=urn:btih:194a4c341487fd12d36718054c1e8fef4358b2ab3",
    "subscription_id": null,
    "status_message": "\u2193 1.2 MB/s, \u2191 0.0 bytes/s | connected to 36 peers, sending to 0 peers | dl: 2.9 MB / 9.0 MB, ul: 0.0 bytes",
    "status": "DOWNLOADING",
    "down_speed": 1249337,
    "peers_connected": 36,
    "downloaded": 2999431,
    "file_id": null,
    "peers_sending_to_us": 22,
    "percent_done": 30,
    "tracker_message": null,
    "name": "A video",
    "created_at": "2012-03-28T09:14:17",
    "error_message": null,
    "save_parent_id": 0
}

Retry

POST /transfers/retry

Retry previously failed transfer.

Parameters

id:ID of the failed download.

Cancel

POST /transfers/cancel

Deletes the given transfers.

Parameters

transfer_ids:Transfer ids separated by commas. Ex: 1,2,3,4

Example response:

{
  "status": "OK"
}

Clean

POST /transfers/clean

Clean completed transfers from the list.

Example response:

{
  "status": "OK"
}