为了能到远方,脚下的每一步都不能少。|

Undefined443

园龄:2年11个月粉丝:13关注:3

使用 aria2 下载文件

Aria2 是一个轻量级的多协议、多来源命令行下载工具。它支持 HTTP、HTTPS、FTP、BitTorrent 和 Metalink 协议,能够在不同的协议之间无缝切换以优化下载速度。

安装

# macOS
brew install aria2

# Ubuntu / Debian
sudo apt install aria2

下载文件

aria 不能设置 socks5 代理

aria2c http://example.com/foo         # 下载 foo
aira2c -o bar http://example.com/foo  # 下载 foo 并重命名为 bar
aria2c -d dir http://example.com/foo  # 下载到 dir 目录

批量下载

  • 下载链接文件中的内容:

    aria2c -i url.list  # 下载 url.list 中的文件
    

    url.list:

    http://example.com/file1.zip
    http://example.com/file2.mp4
    

    可以在链接文件中配置下载路径和文件名:

    http://example.com/file1.zip
      dir=/path/to/save/file1
      out=file1.zip
    http://example.com/file2.mp4
      dir=/path/to/save/videos
      out=video.mp4
    
  • 在终端直接使用 HereDoc 下载:

    aria2c -i - <<EOF
    http://example.com/file1.zip
      dir=/path/to/save/file1
      out=file1.zip
    http://example.com/file2.mp4
      dir=/path/to/save/videos
      out=video.mp4
    EOF
    

本文作者:Undefined443

本文链接:https://www.cnblogs.com/Undefined443/p/18503135

版权声明:本作品采用署名-非商业性使用-相同方式共享 4.0 国际许可协议进行许可。

posted @   Undefined443  阅读(126)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
收起