本文主要讲解下载工具Aria2的安装与配置;
Aria2安装与配置
Aria2是一个命令行工具,优点是轻量、开源,支持多协议、多线程,可以直接使用Aria2命令来下载BT种子等资源文件;
同时aria2也可以配合前端比如Aria2 Web UI、AriaNg等使用;
安装
官方版本
官方版本直接通过apt或者yum安装即可;
集成版本
因为Aria2很强大,同时因为强大又没那么容易上手,所以有些人就想办法把Aria2集成到其他软件或者封装成图形界面,使得它能够更方便使用。
1.Persepolis Download Manager(Windows/Linux/macOS)
官网: https://persepolisdm.github.io
下载:
Debian/Ubuntu: https://github.com/persepolisdm/persepolis/releases/download/2.4.2/persepolis_2.4.2.1_all.deb
macOS: https://github.com/persepolisdm/persepolis/releases/download/2.4.2/persepolis_2_4_2_mac.dmg
Windows 32位: https://github.com/persepolisdm/persepolis/releases/download/2.4.2/persepolis_2_4_2_windows_32bit.exe
Windows 64位: https://github.com/persepolisdm/persepolis/releases/download/2.4.2/persepolis_2_4_2_windows_64bit.exe
纯粹的套壳之作,开箱即用,虽然目前还有些问题,但是还是挺好的
2.PanDownload(Windows)
下载地址: https://github.com/cherryljr/PanDownload/raw/master/PanDownload.exe
将Aria2用于百度云下载,无需浏览器插件,无需复制粘贴,登录账户一点即下
3.Aria2GUI(macOS)
下载地址: https://github.com/yangshun1029/aria2gui
就是单纯的Yaaw+内置Aria2,但是效果其实挺好,配合自带的浏览器插件还是不错的
4.Maria(macOS)
下载地址: https://github.com/shincurry/Maria
这个集成了Aria2,也能用You-Get来进行部分下载,也是不错的
魔改版本
还有个改版的,把并发线程提到了128,暴力下载
GNU/Linux 64位: https://github.com/xzl2021/aria2-static-builds-with-128-threads/releases/download/v1.32.0/aria2-1.32.0-linux-gnu-64bit-build1.tar.bz2
配置
通常安装的aria2是没有配置文件的, 所以我们要手动创建配置文件;
在/etc/aria2目录下创建aria2.conf和aria2.session文件:
1 | $ cd /etc/ |
编辑aria2.conf文件内容,内容如下:
1 | # Trackers |
上面的配置可以根据个人需要更改, 如果未配置则为默认项;
其中:
- bt-tracker可以设置为更新的内容;
- dir设置为下载目录;
- input-file: aria2.session的位置;
而Github提供了最新的tracker, 自行到这里取最新的添加,每个地址之间以逗号分开:
https://github.com/ngosang/trackerslist
更全的配置文件说明见:
启动
直接使用下面的命令启动:
1 | aria2c --conf-path=/etc/aria2/aria2.conf -D |
你就可以使用aria2下载你的bt种子或磁力链了,aria2c -h 查看使用帮助
使用
我们使用aria2命令直接下载:
1、直链下载
下载直链文件,只需在命令后附加地址,如:
1 | aria2c http://xx.com/xx |
如果需要重命名为yy的话加上--out或者-o参数,如:
1 | aria2c --out=yy http://xx.com/xx |
使用aria2的分段和多线程下载功能可以加快文件的下载速度,对于下载大文件时特别有用。-x 分段下载,-s 多线程下载,如:
1 | aria2c -s 2 -x 2 http://xx.com/xx |
这将使用2个连接和2个线程来下载该文件。
2、BT下载
种子和磁力下载:
1 | aria2c 'xxx.torrnet' |
列出种子内容:
1 | aria2c -S xxx.torrent |
下载种子内编号为1、4、5、6、7的文件,如:
1 | aria2c --select-file=1,4-7 xxx.torrent |
设置bt端口:
1 | aria2c --listen-port=3653 ‘xxx.torrent’ |
3、限速下载
单个文件最大下载速度:
1 | aria2c --max-download-limit=300K -s10 -x10 'http://xx.com/xx' |
整体下载最大速度:
1 | aria2c --max-overall-download-limit=300k -s10 -x10 'http://xx.com/xx' |
浏览器插件
Safari
Safari2Aria: 在Safari中管理Aria2,并且劫持默认下载方式
下载地址: https://github.com/miniers/safari2aria
115
115: 使用Aria2下载115资源
下载地址: https://github.com/acgotaku/115/
百度网盘
BaiduExporter: 网盘助手, 使用Aria2下载百度网盘资源,这个因为被Chrome商店下架了,需要安装参考——>传送门
下载地址: https://github.com/acgotaku/BaiduExporter
YAAW
YAAW for Chrome: 在chrome中直接内置一个YAAW,用于直接管理Aria2
下载地址: https://chrome.google.com/webstore/detail/yaaw-for-chrome/dennnbdlpgjgbcjfgaohdahloollfgoc
迅雷离线
- Chrome Extension: ThunderLixianAssistant
- UserScript: ThunderLixianExporter
旋风离线
- UserScript: XuanFengEx
- UserScript: LixianExporter
其他脚本
- Chrome Extension: 添加到aria2
WebGUI
YAAW:
下载地址: https://github.com/binux/yaaw
YAAW 使用说明
在打开index.html后要配置JSON-RPC Path;
并且确保在aria2配置中开启了RPC, 已经端口号对应等;
JSON-RPC Path
JSON-RPC Path默认为:http://localhost:6800/jsonrpc如果提示
Aria2 RPC 服务器错误按照以下方法修改
host: 指运行 Aria2 所在机器的 IP 或者名字
port: 使用--rpc-listen-port选项设置的端口, 未设置则是6800普通情况设置为:
http://host:port/jsonrpc使用
--rpc-secret=xxxxxx选项设置为:http://token:xxxxxx@host:port/jsonrpc使用
--rpc-user=user --rpc-passwd=pwd选项设置为:http://user:pwd@host:port/jsonrpc以上
JSON-RPC Path中的http可以用ws替代, 代表使用WebSocket 协议当使用 https://aria2c.com 访问时, 需要使用
https或wss协议Tips
- 在 YAAW 中对 Aria2 的设置会在 Aria2 重启后丢失, 必要的设置请写入配置文件
- 已经下载完成的任务会在 Aria2 重启后消失, 除非启用了
--force-save选项- 因界面已汉化, 其他不再赘述.
webgui-aria2:
下载地址: https://github.com/ziahamza/webui-aria2
AriaNG:
下载地址: https://github.com/mayswind/AriaNg
Glutton:
下载地址: https://github.com/NemoAlex/glutton
附录
参考文章: