Preface
What is Aria2?
Aria2 is a free, cross-platform command line interface download manager that supports HTTP, HTTPS, FTP, Bittorrent and Metalink.
Another feature of Aria2 is that you can use JSON-RPC and XML-RPC for HTTP remote download control, and the JSON-RPC interface is available through WebSocket.
I mainly use to download seed Bittorrent files and multithreaded downloads.
Preparation before configuration
Installed Homebrew 。
Ability of using vim or other editors.
Common commands:
Press the i key in the open vim interface to enter edit mode; Press the Esc key to exit edit mode and enter command line mode; Use the :wq command to save and exit.
Install and configure Aria2
|
|
Edit the configuration file aria2.conf :
|
|
Considerations for this profile are as follows:
- RPC mode is enabled by default.
- The RPC authorization token has been set, please change it to your own.
- BT tracker has been added.
Set to self-boot
Create a user’s startup file
|
|
Write as follows:
|
|
Note:
Be sure to change the user name of the WorkingDirectory directory to your own user name.
|
|
Add and enable self-startup files
|
|
Note:
If you have previously added aria2 startup files, remember to delete the startup items and then add them again!
Add automatic update BT tracker function
Create a trackers-list-aria2.sh script
|
|
The script reads as follows:
|
|
Set permissions:
|
|
Set up the task scheduler to achieve automatic updates
Compile the current user task plan:
|
|
Use crontab -l command to view the current user task schedule. The contents are as follows:
|
|
2022/05/27 update:
Add MAILTO = “” configuration to avoid You have new mail prompts.
If such notification has already occurred, enter
Or you can command directly:
|
|
The above indicates:
Automatically update BT tracker and restart aria2 service at 6: 00 p.m. every day.
Cancel the scheduled task:
1
crontab -e
Then delete the content manually, or run it directly:
1
crontab -l 2&> /dev/null| sed "/trackers-list-aria2.sh/d" | crontab
Add Download-Notification
Final effect: when the download is complete, a prompt box will pop up in the upper right corner of the screen to display the file name of the completed download, and voice broadcast: “there is a file that has been downloaded, please check it!”
Create a download-complete-hook.sh script
|
|
The script reads as follows:
|
|
Set permissions:
|
|
Add Hook Settings
The aria2.conf configuration file above already contains the following, and those who use the above file can skip this section directly.
Add the following to the aria2.conf :
|
|
Aria2 web UI
Do not need to install, just use the browser to open: AriaNg UI .
PRC Setting
Set according to the PRC-related settings in the aria2.conf configuration file.
Install the browser download plug-in
- Built-in an offline AriaNg version of UI
- Integrate right-click download menu
The built-in offline AriaNg version also requires PRC Setting , otherwise you will not be able to connect successfully.
Reference only
Download the file from the network disk
网盘直链下载助手: it needs to be enabled by installing script managers such as the extension plug-in Violentmonkey or Tampermonkey .
Usage
Use with Aria2 for Chrome Plugin-in .
- Select the file you want to download and click “Aria download” or “RPC download” on the download assistant page to push it to the Aria2 UI interface.
- After clicking the appropriate option with the mouse, select “send Link”, and then confirm the download.