Open halida opened 9 years ago
+1 to this. Even without the functionality in aria2 natively - you could do this via rpc start/pause calls triggered using JS to schedule.
Aria pause
#!/bin/sh
curl http://127.0.0.1:6800/jsonrpc -H "Content-Type: application/json" -H "Accept: application/json" --data '{"jsonrpc": "2.0","id":1, "method": "aria2.pauseAll", "params":[]}'
exit 0
Aria unpause
#!/bin/sh
curl http://127.0.0.1:6800/jsonrpc -H "Content-Type: application/json" -H "Accept: application/json" --data '{"jsonrpc": "2.0","id":1, "method": "aria2.unpauseAll", "params":[]}'
exit 0
Just use cron.
Thanks @darzur for this greatly helpful comment. although since im not familiar with JSON i had hard time figuring out how to send commands for limiting speed on secret token enabled Aria2.
as he said you can put these commands in cron to get executed at favorite time.
Here are the commands (a bit more noob friendly version):
For pausing all downloads:
curl http://127.0.0.1:6800/jsonrpc -H "Content-Type: application/json" -H "Accept: application/json" --data '{"jsonrpc": "2.0","id":1, "method": "aria2.pauseAll", "params":["token:MySuperTopSecret"]}'
For resuming all downloads:
curl http://127.0.0.1:6800/jsonrpc -H "Content-Type: application/json" -H "Accept: application/json" --data '{"jsonrpc": "2.0","id":1, "method": "aria2.unpauseAll", "params":["token:MySuperTopSecret"]}'
For limiting total download speed:
curl http://127.0.0.1:6800/jsonrpc -H "Content-Type: application/json" -H "Accept: application/json" --data '{"jsonrpc": "2.0","id":1, "method": "aria2.changeGlobalOption", "params":["token:MySuperTopSecret",{"max-overall-download-limit":"5k"}]}'
For unlimiting total download speed:
curl http://127.0.0.1:6800/jsonrpc -H "Content-Type: application/json" -H "Accept: application/json" --data '{"jsonrpc": "2.0","id":1, "method": "aria2.changeGlobalOption", "params":["token:MySuperTopSecret",{"max-overall-download-limit":"0"}]}'
Thanks for the curl sample commands, Can't we add a UI element to webui to make it easy for users?
does anybody know how to do this in the CLI version?
@saleh-mir This is only about CLI, no GUI involved.
@no1xsyzy I meant I have only aria2 installed, and not webui-aria2. Because I see in the curl command that it's sending request to http://127.0.0.1:6800
which I assume is for this webui-aria2 repo.
I'd like to start/stop downloading at some particular time, like download only at 0:00-6:00, Is there any way I can do this?