aria2安装及使用

2018-07-25 12,977

之前的百度网盘会员过期了,下载一点点东西慢出翔。鉴于目前穷困潦倒的生活状态,还是用用免费的好了。所以通过aria2这个工具做一点点改善就成了一个可选项。

使用homebrew安装aria2c

$ brew install aria2
# 安装往常后,运行 aria2c
$ aria2c -h  # 查看帮助
$ man aria2c
# 开启RPC服务()
$ aria2c --enable-rpc --rpc-listen-all -c -x 16 -d /Users/bingo/Downloads --rpc-secret=<--mytoken-->

aria2c配置(RPC mode)

创建 aria2.conf

$ mkdir ~/.aria2
$ cd ~/.aria2
$ touch aria2.conf
$ vim aria2.conf

配置 aria2.conf

# vim aria2.conf
#用户名
#rpc-user=user
#密码
#rpc-passwd=passwd
#上面的认证方式不建议使用,建议使用下面的token方式
#设置加密的密钥
rpc-secret=656CjCKQ0iQUB78eXgIe4TJz8V8i7OdV
#允许rpc
enable-rpc=true
#允许所有来源, web界面跨域权限需要
rpc-allow-origin-all=true
#允许外部访问,false的话只监听本地端口
rpc-listen-all=false
#RPC端口, 仅当默认端口被占用时修改
#rpc-listen-port=6800
#最大同时下载数(任务数), 路由建议值: 3
max-concurrent-downloads=5
#断点续传
continue=true
#同服务器连接数
max-connection-per-server=10
#最小文件分片大小, 下载线程数上限取决于能分出多少片, 对于小文件重要
min-split-size=10M
#单文件最大线程数, 路由建议值: 5
split=10
#下载速度限制
max-overall-download-limit=0
#单文件速度限制
max-download-limit=0
#上传速度限制
max-overall-upload-limit=0
#单文件速度限制
max-upload-limit=0
#断开速度过慢的连接
#lowest-speed-limit=0
#验证用,需要1.16.1之后的release版本
#referer=*
#文件保存路径, 默认为当前启动位置
dir=/Users/xxx/Downloads
#文件缓存, 使用内置的文件缓存, 如果你不相信Linux内核文件缓存和磁盘内置缓存时使用, 需要1.16及以上版本
#disk-cache=0
#另一种Linux文件缓存方式, 使用前确保您使用的内核支持此选项, 需要1.15及以上版本(?)
#enable-mmap=true
#文件预分配, 能有效降低文件碎片, 提高磁盘性能. 缺点是预分配时间较长
#所需时间 none < falloc ? trunc << prealloc, falloc和trunc需要文件系统和内核支持
file-allocation=prealloc

启动aria2

$ aria2c --conf-path=/Users/xxx/.aria2/aria2.conf -D


前端工具

百度网盘 BaiduExporter for Chrome

https://github.com/acgotaku/BaiduExporter

image01.png

不知何故,点击ARIA2 RPC”无法使用,使用文本导出,在终端执行。看起来不完美,但不可否认,速度提升了。

image06.png


不支持rpc-secret,如需使用,需要在配置文件中去除 rpc-secret 配置。

webui-aria2

https://github.com/ziahamza/webui-aria2

$ git clone --depth 1 https://github.com/ziahamza/webui-aria2
$ cd webui-aria2
$ open index.html # 因为这是纯前端的应用,所以直接用浏览器打开index.html即可
$ node node-server.js   # 启动服务
    # WebUI Aria2 Server is running on http://localhost:8888

image05.png

前端界面除了webui-aria2外,还有如下两三种,但都不能填入身份验证信息(配置文件中需要移除 rpc-secret ),有不安全的嫌疑。


YAAW-for-Chrome (Yet Another Aria2 Web Frontend)

https://github.com/acgotaku/YAAW-for-Chrome

其实跟YAAW是同一个东西,只不过是本地端软件。

image03.png

Safari2Aria

https://github.com/miniers/safari2aria

image04.png

后记

后续有空的话,可以考虑fork相关项目,进行些代码贡献,至少添加些参数还是问题不大的。


本文作者:Bingo

本文为安全脉搏专栏作者发布,转载请注明:https://www.secpulse.com/archives/73748.html

Tags:
评论  (0)
快来写下你的想法吧!

Bingo

文章数:2 积分: 8

安全问答社区

安全问答社区

脉搏官方公众号

脉搏公众号