Aria2

网络 by 神秘人 at 2016-12-03

aria2 是一个自由、开源、轻量级多协议和多源的命令行下载工具。它支持 HTTP/HTTPS、FTP、SFTP、 BitTorrent 和 Metalink 协议。

aria2 可以通过内建的 JSON-RPC 和 XML-RPC 接口来操纵。

aria2 下载文件的时候,自动验证数据块。它可以通过多个来源或者多个协议下载一个文件,并且会尝试利用你的最大下载带宽。

debian下安装

apt-get install aria2

下载多个文件,从列表中

aria2c -i down.txt

将要下载的URL,输入down.txt中,实现自动下载

-c      断点续传
-i      参数表示读取外部链接文件
-x      -x2表示增加的线程数

注意:当源地址存在诸如 &, * 等 shell 的特殊字符,请使用单引号或双引号把 URI 包含起来。

1、Download from WEB
# aria2c -c -s 5 http://example.org/mylinux.iso
-c : 断点续传
-s : 使用线程数

2、Download from 2 sources
# aria2c http://a/f.iso   ftp://b/f.iso

3、Download using 2 connections per host
 # aria2c -x2 http://a/f.iso

4、BitTorrent Magnet URI
# aria2c 'magnet:?xt=urn:btih:248D0A1CD08284299DE78D5C1ED359BB46717D8C'

5、Metalink
# aria2c http://example.org/mylinux.metalink

6、Download URIs found in text file
# aria2c -i uris.txt

7、BT
# aria2c /tmp/CentOS-6.3-i386-bin-DVD1to2.torrent
# aria2c http://mirrors.163.com/centos/6.6/isos/x86_64/CentOS-6.6-x86_64-minimal.torrent