Configure Aria2 on macOS
Introduction to Aria2
Aria2 is a multi-functional downloading tool that supports multi-threading, P2P downloading, and BitTorrent downloading at the same time. Its speed also depends on network speed and resource quality. But in general, multi-threaded downloads are always much faster than ordinary browser downloads, , wget
and downloads, and Aria2 also supports remote transfer downloads.curl
In fact, BT downloads are more effective when placed on a public network server. I use it at home (for example: macOS or Raspberry Pi), and the effect is not good.
This tutorial will tell you how to build Aria2 on macOS and configure RPC interaction. Support X86 version and Arm64 version.
corresponding video
It is recommended to operate in conjunction with the corresponding video in this article:
Homebrew
First, we need to install Homebrew on macOS. There are many ways to do this. You can use the official one-click installation script:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Of course, if you cannot connect to GitHub in your region, you can refer to my blog to install Homebrew:
The effect of installing Homebrew:
After that, you can use Homebrew to install Aria2
Install Aria2
Because there is brew, you only need to synchronize the Aria2 file to the local:
brew install aria2
At this time, you can actually use the Aria2 command to download files. However, generally we will configure it in RPC mode, which is convenient for Aria NG to call, or to directly transfer and download through the Chrome front-end plug-in.
Configure RPCs
Now, we need to configure RPC. The final effect:
In the interactive mode, we can use a program like Aria NG to connect:
in this way, we will get to a console similar to Thunder, which is convenient for us to download software. Activating this Aria2 RPC is simple.
Configure aria2.conf
Here is a one-click deployment script for users with strong financial resources:
If you don't want to pay, it doesn't matter, the following is a manual deployment tutorial.
First of all, we need to configure a aria2.conf
file, which needs to be under the user's "home directory" .aria2文件夹
. So, let's create it manually, open Terminal (terminal), and enter:
# 进入用户家目录
cd ~
# 创建Aria2的配置目录
mkdir .aria2
# 进入目录内
cd .aria2
# 获取当前终端绝对路径
pwd
Get the current address of the terminal, mine is: /Users/mintimate/.aria2
.
After that, download my config file:
After decompression, get:
In Terminal, open .aria2文件夹
:
# 打开当前Terminal所在目录
open ./
Move the three files just now into it:
and open aria2.conf
the file, configure the personalized parameters:
change the content:
dir
: The file downloaded through Aria2, storage address (absolute path)on-download-stop
: point to the configuration filedeleteAria2.sh
on-download-complete
: also point to the configuration filedeleteAria2.sh
dht-file-path
: point to the configuration filedht.dat
dht-file-path6
: also point to the configuration filedht.dat
rpc-secret
: Set Aria2 authentication remote code
Start Aria2 RPC
We can now start our Aria2 RPC from within Terminal. input the command:
aria2c --conf-path="/Users/mintimate/.aria2/aria2.conf"
eg my aria2.conf file is created under:
/Users/mintimate/.aria2/
so when I run:aria2c --conf-path="/Users/mintimate/.aria2/aria2.conf
If you need to stop the interaction: Note ⚠️ It is not to close the Terminal directly, it is Ctrl+C, press Ctrl+C to close!
layout script
It is a bit troublesome to start according to the above method; therefore, we set up a shell script so that we can start it every time we open Terminal. Because Terminal is started in the user's "home directory" every time, so we create a one-click script under the "home directory":
# 进入家目录
cd ~
# 创建shell文件
touch aria2.sh
# 对空的shell文件追加内容
echo 'aria2c --conf-path=/Users/mintimate/.aria2/aria2.conf' >aria2.sh
# 添加执行权限
chmod +x aria2.sh
Again, press Ctrl+C to close.
END
At this point, Aria2 is deployed and installed. As for downloading Baidu cloud content, I won’t introduce too much here (for fear of copyright). However, let me introduce another Chrome and Edge plugin: YAAW Aria2.
The setting method is very simple, set the RPC in the YAAW plug-in:
later, when you want to download something. Right-click on the browser to send it to Aria2 for download (and you can carry Header and Cookies, and you can also send it to a remote server for offline download~).