Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Managing Downloads

Methods for adding, removing, pausing, and controlling download tasks.

Previous: Connecting · Next: Checking Status


Methods

MethodDescriptionParametersReturns
pin.addUriAdds a new download task from one or more URIs.[uris (Array of Strings), options (Object, Optional), position (Integer, Optional)]gid (String)
pin.addMetalinkAdds a download by providing a base64-encoded Metalink XML string.[metalink (Base64 String), options?, position?]gid (String)
pin.addTorrentAdds a BitTorrent download by uploading a “.torrent” file.[torrent (Base64 String), uris (Array of Strings, Optional), options?, position?]gid (String)
pin.removeRemoves the download denoted by gid.[gid (String)]gid (String)
pin.removeAndFileRemoves the download and moves its file to Trash.[gid (String)]true (Boolean)
pin.forceRemoveImmediately removes the download denoted by gid.[gid (String)]gid (String)
pin.pausePauses the active/waiting download denoted by gid.[gid (String)]gid (String)
pin.forcePauseForcefully pauses the download denoted by gid.[gid (String)]gid (String)
pin.unpauseUnpauses the paused download denoted by gid.[gid (String)]gid (String)
pin.pauseAllPauses all active/waiting downloads.[]OK (String)
pin.forcePauseAllForcefully pauses all active/waiting downloads.[]OK (String)
pin.unpauseAllUnpauses all paused downloads.[]OK (String)
pin.changePositionAdjusts the queue position of a download.[gid (String), pos (Int), how (String)]0 (Int)
pin.changeUriDynamically removes and adds mirror URLs to a task.[gid (String), fileIndex (Int), delUris (Array), addUris (Array)]Array of Results
pin.resolveUrlResolves a URL to its final direct download link.[url (String)]ResolveResponse (Object)

Task Options

When passing an options object to pin.addUri or pin.changeOption, these are the most common keys:

  • dir: Target directory to store the file.
  • out: The file name of the downloaded file.
  • split: (Integer) Number of connections to use (Default: 5).
  • max-connection-per-server: (Integer) Max connections to a single server (Default: 1).
  • min-split-size: (String) Minimum size to split a chunk (e.g., 1M).
  • max-download-limit: (String) Speed limit for the download (e.g., 50K, 0 for unlimited).
  • header: (Array of Strings) Custom HTTP Headers.
  • user-agent: (String) Custom User-Agent string.

For the complete list of all configuration keys and defaults, see Configuration.