aria2 选项参考
只收录真正会用到的选项。每一条都把 aria2c 参数对应到 aria2.conf 键,并给出示例。这是对官方手册(完整列表)的精选补充。
| 参数 | aria2.conf 键 | 说明 | 示例 |
|---|---|---|---|
-d | dir | 保存下载文件的目录。 | aria2c -d /downloads URL |
-o | out | 指定输出文件名。 | aria2c -o file.iso URL |
-c | continue | 继续下载部分完成的文件。 | aria2c -c URL |
-i | input-file | 下载文本文件中列出的所有 URI。 | aria2c -i urls.txt |
-j | max-concurrent-downloads | 同时进行的最大下载数量。 | aria2c -j 5 URL |
-Z | | 一次性获取所有 URI(批量模式)。 | aria2c -Z URL1 URL2 |
--save-session | save-session | 将当前下载写入会话文件,以便日后继续。 | aria2c --save-session=aria.session URL |
--save-session-interval | save-session-interval | 自动保存会话文件的间隔(秒)。 | --save-session-interval=60 |
--allow-overwrite | allow-overwrite | 覆盖已存在文件,而不是失败退出。 | --allow-overwrite=true |
-x | max-connection-per-server | 每个服务器的连接数(1–16)。数值越大,大文件越快。 | aria2c -x 16 URL |
-s | split | 将文件拆分为 N 个分片并行下载。 | aria2c -s 16 URL |
-k | min-split-size | 分片的最小大小。 | aria2c -k 1M URL |
-m | max-tries | 放弃前的重试次数。 | aria2c -m 5 URL |
--retry-wait | retry-wait | 两次重试之间的等待秒数。 | --retry-wait=5 |
-t | timeout | 连接超时(秒)。 | aria2c -t 60 URL |
--connect-timeout | connect-timeout | 建立连接的超时时间。 | --connect-timeout=30 |
--lowest-speed-limit | lowest-speed-limit | 速度低于该值时中止下载。 | --lowest-speed-limit=10K |
-U | user-agent | 覆盖 HTTP User-Agent。 | aria2c -U "Mozilla/5.0" URL |
--referer | referer | 发送 Referer 请求头。 | --referer="https://example.com" |
--header | header | 添加自定义 HTTP 请求头。 | --header="Authorization: Bearer X" |
--load-cookies | load-cookies | 从 Netscape 格式文件读取 Cookie。 | --load-cookies=cookies.txt |
--check-certificate | check-certificate | 验证 TLS 证书(仅在信任来源时禁用)。 | --check-certificate=false |
--ca-certificate | ca-certificate | CA 证书包的路径。 | --ca-certificate=/etc/ssl/certs/ca-certificates.crt |
-V | check-integrity | 校验分片校验和(Metalink/BitTorrent)。 | aria2c -V URL |
--bt-tracker | bt-tracker | 用于种子的逗号分隔 Tracker 列表。 | --bt-tracker="udp://tracker.opentrackr.org:1337/announce" |
--bt-max-peers | bt-max-peers | 每个种子的最大 Peer 数(0 = 不限)。 | --bt-max-peers=128 |
--enable-dht | enable-dht | 为无 Tracker 种子启用 DHT 网络。 | --enable-dht=true |
--bt-enable-lpd | bt-enable-lpd | 启用本地 Peer 发现。 | --bt-enable-lpd=true |
--seed-ratio | seed-ratio | 达到该上传/下载比后停止做种(0 = 一直做种)。 | --seed-ratio=1.0 |
--seed-time | seed-time | 完成后的做种分钟数。 | --seed-time=60 |
--bt-save-metadata | bt-save-metadata | 从磁力链接保存种子元数据。 | --bt-save-metadata=true |
--bt-seed-unverified | bt-seed-unverified | 不校验已有分片直接做种。 | --bt-seed-unverified=true |
--enable-rpc | enable-rpc | 启动 JSON-RPC/XML-RPC 服务器。 | --enable-rpc=true |
--rpc-listen-all | rpc-listen-all | 监听所有网卡(仅在安全环境下使用)。 | --rpc-listen-all=true |
--rpc-listen-port | rpc-listen-port | RPC 端口(默认 6800)。 | --rpc-listen-port=6800 |
--rpc-secret | rpc-secret | 使用 RPC 接口所需的密钥令牌。 | --rpc-secret=YOUR_SECRET |
--rpc-allow-origin-all | rpc-allow-origin-all | 允许跨域浏览器客户端(Web UI)。 | --rpc-allow-origin-all=true |
-D | daemon | 作为后台守护进程运行。 | aria2c -D --enable-rpc |
-l | log | 将日志写入文件。 | aria2c -l aria2.log URL |
--on-download-complete | on-download-complete | 下载完成时执行的命令。 | --on-download-complete=/path/hook.sh |
--on-download-error | on-download-error | 下载失败时执行的命令。 | --on-download-error=/path/err.sh |
--all-proxy | all-proxy | 适用于所有协议(HTTP/HTTPS/FTP)的 HTTP 代理。不支持 SOCKS。 | --all-proxy="http://127.0.0.1:8080" |
--http-proxy | http-proxy | 仅用于 HTTP 的代理。 | --http-proxy="http://127.0.0.1:8080" |
--all-proxy-user | all-proxy-user | 代理认证的用户名。 | --all-proxy-user=user |
--all-proxy-passwd | all-proxy-passwd | 代理认证的密码。 | --all-proxy-passwd=pass |
--no-proxy | no-proxy | 不使用代理的主机(逗号分隔)。 | --no-proxy=localhost,127.0.0.1 |
--disable-ipv6 | disable-ipv6 | 禁用 IPv6。 | --disable-ipv6=true |
--file-allocation | file-allocation | 预分配模式:none、prealloc、trunc、falloc。 | --file-allocation=falloc |
--disk-cache | disk-cache | 启用磁盘缓存并设置其大小。 | --disk-cache=64M |
--max-download-limit | max-download-limit | 单个下载的速度上限。 | --max-download-limit=1M |
--max-overall-download-limit | max-overall-download-limit | 全局下载速度上限。 | --max-overall-download-limit=5M |
--max-overall-upload-limit | max-overall-upload-limit | 全局上传速度上限。 | --max-overall-upload-limit=1M |
--remote-time | remote-time | 将服务器时间戳应用到文件。 | --remote-time=true |
--auto-file-renaming | auto-file-renaming | 重命名而不是覆盖已存在文件。 | --auto-file-renaming=true |
没有匹配的选项。请尝试“split”“proxy”或“seed”,或查看官方手册。
用这些选项生成配置
使用配置生成器把这些设置变成可直接使用的 aria2.conf,或阅读完整的 aria2 指南。遇到错误时可参考故障排查。