ziahamza / webui-aria2

The aim for this project is to create the worlds best and hottest interface to interact with aria2. Very simple to use, just download and open index.html in any web browser.
MIT License
9.89k stars 1.46k forks source link

Schedule download at particular time #126

Open halida opened 9 years ago

halida commented 9 years ago

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?

mfallu commented 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.

darzur commented 9 years ago

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.

euphoria360 commented 8 years ago

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"}]}'
tmkasun commented 7 years ago

Thanks for the curl sample commands, Can't we add a UI element to webui to make it easy for users?

saleh-old commented 4 years ago

does anybody know how to do this in the CLI version?

no1xsyzy commented 4 years ago

@saleh-mir This is only about CLI, no GUI involved.

saleh-old commented 4 years ago

@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.