Commands.page Logo

Change Aria2c Download Priority Command Ubuntu

This article explains how to adjust the priority of a queued download in aria2c on Ubuntu. It outlines the necessary RPC setup and identifies the specific command method used to reorder downloads within the queue.

Aria2c does not use standard command-line flags to change the priority of a waiting download once the process has started. Instead, you must use the Remote Procedure Call (RPC) interface to manage the queue. The specific method required to change priority is aria2.changePosition.

To use this command, you must start aria2c with RPC enabled. Run the following command to start the client:

aria2c --enable-rpc --rpc-listen-all=true --rpc-secret=your_secret

Once the RPC interface is active, you can change the priority of a download by moving its position in the queue. You will need the Global ID (GID) of the download, which can be retrieved using aria2.tellWaiting.

Use the curl command to send the priority change request to the RPC endpoint. The following example moves a download to the top of the queue (position 0):

curl --header "Content-Type: application/json" \
  --header "Authorization: bearer your_secret" \
  --data '{"jsonrpc":"2.0","id":"1","method":"aria2.changePosition","params":["token:your_secret", "GID_HERE", 0, "POS_SET"]}' \
  http://localhost:6800/jsonrpc

Replace your_secret with the RPC secret you defined and GID_HERE with the actual Global ID of the download. The parameter 0 sets the new position, and POS_SET indicates that the number is an absolute index rather than a relative move. Setting the position to 0 gives the download the highest priority.