aria2c 下载示例
- 下载普通文件
$aria2c "http://host/file.zip"
NOTE: To stop a download, press Ctrl-C. You can resume the transfer by running aria2c with the same argument in the same directory. You can change URIs as long as they are pointing to the same file.
- 下载文件列表
$ aria2c -ifiles.txt -j2
NOTE: -j option specifies the number of parallel downloads.
-
使用代理
- For HTTP:
$ aria2c --http-proxy="http://proxy:8080" "http://host/file" $ aria2c --http-proxy="http://proxy:8080" --no-proxy="localhost,127.0.0.1,192.168.0.0/16" "http://host/file"
-
FTP 下载:
$ aria2c --ftp-proxy="http://proxy:8080" "ftp://host/file"
NOTE: See --http-proxy, --https-proxy, --ftp-proxy, --all-proxy and --no-proxy for details. You can specify proxy in the environment variables. See ENVIRONMENT section.
- 使用带身份认证的http代理
$ aria2c --http-proxy="http://username:password@proxy:8080" "http://host/file"
$ aria2c --http-proxy="http://proxy:8080" --http-proxy-user="username" --http-proxy-passwd="password" "http://host/file"
磁力链接下载
-
Download files with remote Metalink
$ aria2c --follow-metalink=mem "http://host/file.metalink"
-
Download using a local metalink file
$ aria2c -p --lowest-speed-limit=4000 file.metalink NOTE: To stop a download, press Ctrl-C. You can resume the transfer by running aria2c with the same argument in the same directory.
-
Download several local metalink files
$ aria2c -j2 file1.metalink file2.metalink
-
Download only selected files
$ aria2c --select-file=1-4,8 file.metalink NOTE: The index is printed to the console using -S option.
-
Download a file using a local metalink file with user preference
$ aria2c --metalink-location=jp,us --metalink-version=1.1 --metalink-language=en-US file.metalink
BitTorrent 下载
- Download files using a remote BitTorrent file
$ aria2c --follow-torrent=mem "http://host/file.torrent"
- Download using a local torrent file
$ aria2c --max-upload-limit=40K file.torrent
NOTE: –max-upload-limit specifies the max of upload rate
NOTE: To stop a download, press Ctrl-C. You can resume the transfer later by running aria2c with the same argument in the same directory.
- Download using BitTorrent Magnet URI
$ aria2c "magnet:?xt=urn:btih:248D0A1CD08284299DE78D5C1ED359BB46717D8C&dn=aria2"
NOTE: Don’t forget to quote BitTorrent Magnet URIs which include & characters with single(') or double(") quotes when specifying URIs on the command-line.
- Download 2 torrents
$ aria2c -j2 file1.torrent file2.torrent
Only download specific files (usually called “selected download”)
$ aria2c --select-file=1-4,8 file.torrent
NOTE: The index is printed to the console using -S option.
- Load cookies
$ aria2c --load-cookies=cookies.txt "http://host/file.zip"
NOTE: You can use Firefox/Mozilla/Chromium’s cookie files without modification.
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 智能桌面机器人:用.NET IoT库控制舵机并多方法播放表情
· Linux glibc自带哈希表的用例及性能测试
· 深入理解 Mybatis 分库分表执行原理
· 如何打造一个高并发系统?
· .NET Core GC压缩(compact_phase)底层原理浅谈
· 手把手教你在本地部署DeepSeek R1,搭建web-ui ,建议收藏!
· 新年开篇:在本地部署DeepSeek大模型实现联网增强的AI应用
· Janus Pro:DeepSeek 开源革新,多模态 AI 的未来
· 互联网不景气了那就玩玩嵌入式吧,用纯.NET开发并制作一个智能桌面机器人(三):用.NET IoT库
· 【非技术】说说2024年我都干了些啥