# 說明 https://aria2.github.io/manual/en/html/
# 來源 https://github.com/lilyvya/aria2-conf/blob/master/aria2.conf.example
# https://binux.blog/2012/12/aria2-examples/
### 翻譯有誤,所以需再確認說明 ###
# 檔案保存路徑,這裡由下載管理器調用,預設為 Aria2 所在資料夾
dir=D:\Downloads
# 允許外部程式控制 ,預設 false
enable-rpc=true
# 允許所有來源, web 界面跨域權限需要,預設 false
rpc-allow-origin-all=true
# 外部訪問,預設 false
rpc-listen-all=true
# 斷點續傳,只在 HTTP(S) 和 FTP 中生效
continue=true
# 同服務器最大連接數,預設 1(好像不能使用過大的值,窩用20無法打開aria2)
max-connection-per-server=5
# 最小檔案分段大小, 預設 20M,如果檔案大小 < (min-split-size * split)則不分段
min-split-size=10M
# 單一檔案最大線程數, 預設 5
# split=5
# 檔案預分配
# 可用值 none, prealloc, trunc, falloc ,預設 prealloc
# 當使用新型檔案系統,如 ext4, btrfs, xfs 或者 NTFS 檔案系統時,推薦使用 falloc ,這種方式會在瞬間完成大檔案(數 GB )的空間分配
# 不要在傳統檔案系統,如 ext3, FAT32 上使用 falloc ,因為這和使用 prealloc 所需的時間大同
# falloc 和 trunc 需要檔案系統和內核支持
# 警告:使用 trunc 灰常快,但它其實是在檔案系統中設定檔案長度原始資料,並不是分配硬碟空間,所以無法避免硬碟碎片化
# 簡單來說開啟檔案預分配後,如果支持使用 falloc 就使用 falloc ,不支持就用 prealloc ,固態硬盤可以使用 trunc
# 開啟後使用 32 位 aria2 下載大於 4G 的檔案, aria2 會被系統殺掉 (騷年你還在用 32 位系統?)
# 使用 falloc 時,如果有警告[WARN] Gaining privilege SeManageVolumePrivilege failed. ,需要使用管理員權限打開
# 文件預分配, 能有效降低文件碎片, 提高硬碟性能. 缺點是預分配時間較長
# 所需時間 none < falloc ? trunc << prealloc, falloc和trunc需要文件系統和內核支持
file-allocation=falloc
# 證書校驗,預設 true
check-certificate=false
# 全域代理
#all-proxy=http://127.0.0.1:1080/pac?auth=
# 代理請求方式,可用值 get, tunnel ,HTTPS 下載時一直使用 tunnel
#proxy-method=tunnel
# 不代理的主機名,域名和IP
#no-proxy=<DOMAINS>
# rpc
# 用戶名
#rpc-user=user
# 密碼
#rpc-passwd=passwd
# token驗證
# 值可以為:我就是叫紫媽怎麼了?有本事突然從我背後出現,把我的臉按在鍵盤上3sw4yde5uf6tgyhujikpo
#rpc-secret=3sw4yde5uf6tgyhujikpo
# https加密,啟用之後要設定公鑰,私鑰的檔案路徑
#rpc-secure=true
# 加密設定公鑰
#rpc-certificate=example.crt
# 加密設定私鑰
#rpc-private-key=example.key
# rpc端口,預設 6800
#rpc-listen-port=6800
# 下載
# 關閉 ipv6 ,預設 false
#disable-ipv6=true
# 最大同時下載數, 預設 5
#max-concurrent-downloads=3
# HTTP 回傳 503 時重試下載的秒數,0 為不重試下載,預設為 0
retry-wait=10
# 最大重試次數,0 為無限制,預設為 5
# max-tries=0
#服務器回傳檔案找不到最大重試次數, 0 為一直重試,預設為 0
max-file-not-found=5
# 使用服務器檔案時間,預設 false
# remote-time=true
# 使用 UTF-8 編碼,預設 false
content-disposition-default-utf8=true
# 如果相同的檔案已存在重命名檔案,預設 true
#auto-file-renaming=
# always-resume 預設為 true
#always-resume=true
#當 N 個連結獲取失敗時,就使用分段下載,數值為 0 時則在全部連結失敗後才使用分段,預設為 0
#max-resume-failure-tries=5
#referer ,這裡由下載管理器調用
#如果為 * ,下載 URI 也可以是 referer ,這在開啟 parameterized-uri 時很有用
#referer=<REFERER>
#參數化URI, balabala 不懂,預設 false
#Enable parameterized URI support. You can specify set of parts: http://{sv1,sv2,sv3}/foo.iso. Also you can specify numeric sequences with step counter: http://host/image[000-100:2].img. A step counter can be omitted. If all URIs do not point to the same file, such as the second example above, -Z option is required. Default: false
#parameterized-uri=true
# 全域下載速度限制
# 0為不受限制,預設為0,大小為 bytes/sec ,也可以使用 K 或 M,下同
# max-overall-download-limit=0
# 單一檔案下載速度限制
# max-download-limit=0
# 全域上傳速度限制
# max-overall-upload-limit=100K
# 單一檔案上傳速度限制
# max-upload-limit=0
# 中斷速度過慢的連接,在 BT 中不生效
# lowest-speed-limit=0
# 檔案快取,快取到記憶體裡,大小使用 K 或 M ,為 0 時關閉,預設 16M
# disk-cache=64M
# 將檔案映射到記憶體,預設 false,file-allocation=prealloc 才能使用
# enable-mmap=true
# 映射記憶體檔案大小最大限制
# 檔案大小由一次下載中的全部檔案決定,如果總大小大於設定值則禁用mmap
# 預設9223372036854775807 (單位有點迷)
# max-mmap-limit=1024M
# 大小小於這個值的檔案不進行檔案預分配,預設 5M
# no-file-allocation-limit=4096K
# 證書效驗檔案
# ca-certificate=<FILE>
# 任務記錄
input-file=aria2.session
# 保存錯誤/未完成的任務記錄
# 會在 dir 下生成同名 .aria2 檔案,當 force-save=true 時不刪除, force-save=false 時刪除
save-session=aria2.session
# 每隔幾秒保存,預設 0, 0 為 aria2 退出時保存,不管設定為多少 aria2 退出時都會保存 session
# save-session-interval=60
# 即使任務被移除或完成了也保存 session (使用 save-session 值) ,對 BT 有用,預設 false
# 會檢查 session ,打開後如果按照本配置打開 aria2 下載下來的檔案如果沒有刪除原始資料會再給你下載下來
# 簡單來說: false 不保存完成記錄,true 保存完成記錄
#force-save=true
#強迫症專用, force-save=true 可時刪除 dir 下同名.aria2
# 日志
# 級別,可用值 debug, info, notice, warn, error ,預設 debug
log-level=warn
# 位置
log=aria2.log
# 輪詢事件
# 可用值 epoll, kqueue, port, poll, select ,預設值與系統有關
# epoll, kqueue, port and poll 需要系統支持
# epoll 支持最新的 Linux , kqueue 支持最新的 BSD 系(包括 MAC OS X), port 支持 Open Solaris
#event-poll=
# BitTorrent
# 啟用本地節點查找,預設 false,如果種子設定為 private , aria2 不會使用此選項
# bt-enable-lpd=true
# 當值為 true| mem 時,如果下載的檔案是一個種子(以.torrent結尾)時, 就自動下載
# 當值為 mem 時,種子不會寫入硬碟,但會一直在記憶體中
# 當值為 false 時不自動下載
# 預設 true
#follow-torrent=flase
# 監聽端口,預設6881-6999
# , 為分隔不同端口, - 為兩個值中的所有端口,如:'6881-6889,6999', '6881,6885'
#listen-port=<PORT>...
# 強制加密,開啟相當於 bt-require-crypto=true 和 bt-min-crypto-level=arc4 ,預設 false
# bt-force-encryption=true
# 要求加密,預設 false
#bt-require-crypto=true
# 最低加密級別,可用值 plain, arc4 ,預設 plain
#bt-min-crypto-level=arc4
# 最大打開檔案數量,預設 100
#bt-max-open-files=100
# 單種子最大連接數,預設 55 ,0 為不限制
#bt-max-peers=55
# 如果單種子的速度低於此值, aria2 會暫時增加種子的連接數量來增加下載速度,預設 50K
#bt-request-peer-speed-limit=50K
#新增額外的 tracker
#bt-tracker=<URI>[,...]
#要排除的 tracker,可以使用值 '*' (不要引號),當使用 * 時會移除所有通告的的 tracker
#bt-exclude-tracker=<URI>[,...]
# tracker 重連超時時間(單位為秒),預設 60
#bt-tracker-connect-timeout=60
#tracker 超時時間(單位為秒),預設 60
#bt-tracker-timeout=60
# DHT
# 打開 ipv4 DHT, 預設 true
# 當種子檔案設定了 private ,即使為 true ,aria2也不會從 DHT 中下載, ipv6 也一樣
#enable-dht=true
# 打開 ipv6 DHT,預設 true
#enable-dht6=true
# BT 和 DHT 使用的外部 IP ,可能會發送到BitTorrent tracker
# 對於DHT,此選項應該被設定成要報告的本地節點,這對於在 private 網絡中使用 DHT 很重要
# For DHT, this option should be set to report that local node is downloading a particular torrent. This is critical to use DHT in a private network
#bt-external-ip=<IPADDRESS>
# DHT和 UDP tracker監聽端口,預設 6881-6999
#dht-listen-port=<PORT>...
# 啟用種子交換,預設 true ,如果種子設定為 private ,即使為 true 也不會啟用這個特性
#enable-peer-exchange=true
# 做種流量比例, 0.0 時一直做種,預設 1.0
#seed-ratio=0.0
# 改變 IPv4 DHT 路由表保存路徑,預設 $HOME/.aria2/dht.dat
dht-file-path=dht.dat
# 改變 IPv6 DHT 路由表保存路徑,預設 $HOME/.aria2/dht6.dat
dht-file-path6=dht6.dat
# 修改 UA,預設 aria2/$VERSION
# 只在 HTTP(S) 中有效
#user-agent=<USER_AGENT>
# peer-id,預設 A2-$MAJOR-$MINOR-$PATCH- ,比如在 aria2 version 1.18.8 裡為 A2-1-18-8-
# 在 BT 中只有前20個字符長度生效,超出的將被丟棄,不足則隨機填充至20個字符
#peer-id-prefix=<PEER_ID_PREFIX>
# 保存原始資料至 .torrent 檔案,預設 false
#bt-save-metadata=true
# 從以前的種子下載不用驗證散列,預設 false
# Seed previously downloaded files without verifying piece hashes
#bt-seed-unverified=true
# 種子哈希效驗,開啟時使用 check-integrity 選項和檔案完成散列檢查後才會繼續,如果你想要下到損壞的檔案那就關了吧。預設 true
# If true is given, after hash check using --check-integrity option and file is complete, continue to seed file. If you want to check file and download it only when it is damaged or incomplete, set this option to false. This option has effect only on BitTorrent download. Default: true
#bt-hash-check-seed=true
# 通過驗證散列或整個檔案的哈希值來檢查檔案完整性,只在 BT 中生效,HTTP(S)/FTP 使用 checksum 選項,預設 false
#check-integrity=false