Skip to content

A full-featured download manager.

refactor: arai2 config

Dr_rOot36551da19e8f
diff --git a/extra/darwin/engine/aria2.conf b/extra/darwin/engine/aria2.conf
old mode 100755
new mode 100644
index 6d51fe81..52929e8d
--- a/extra/darwin/engine/aria2.conf
+++ b/extra/darwin/engine/aria2.conf
@@ -1,123 +1,71 @@
-## '#'开头为注释内容, 选项都有相应的注释说明, 根据需要修改 ##
-## 被注释的选项填写的是默认值, 建议在需要修改时再取消注释 ##
-## 添加了@和默认启用的选项都是系统需要调用的,请不要随意改动否则可能无法正常运行
+###############################
+# Motrix macOS Aria2 config file
+#
+# @see https://aria2.github.io/manual/en/html/aria2c.html
+#
+###############################
-## 文件保存相关 ##
-# 文件的保存路径(可使用绝对路径或相对路径), 默认: 当前启动位置
-# 此项 OS X 无法使用 $HOME 及 ~/ 设置路径 建议使用 /users/用户名/downloads
-#@dir=$HOME/downloads
-# 启用磁盘缓存, 0为禁用缓存, 需1.16以上版本, 默认:16M
-#@disk-cache=32M
-# 文件预分配方式, 能有效降低磁盘碎片, 默认:prealloc
-# 预分配所需时间: none < falloc ? trunc < prealloc
-# falloc和trunc则需要文件系统和内核支持
-# NTFS建议使用falloc, EXT3/4建议trunc, MAC 下需要注释此项
-# file-allocation=none
-# 断点续传
-#@continue=true
-
-## 下载连接相关 ##
-
-# 最大同时下载任务数, 运行时可修改, 默认:5
-#@max-concurrent-downloads=10
-# 同一服务器连接数, 添加时可指定, 默认:1
-#@max-connection-per-server=15
-# 最小文件分片大小, 添加时可指定, 取值范围1M -1024M, 默认:20M
-# 假定size=10M, 文件为20MiB 则使用两个来源下载; 文件为15MiB 则使用一个来源下载
-#@min-split-size=10M
-# 单个任务最大线程数, 添加时可指定, 默认:5
-#@split=15
-# 整体下载速度限制, 运行时可修改, 默认:0
-#@max-overall-download-limit=0
-# 单个任务下载速度限制, 默认:0
-#@max-download-limit=0
-# 整体上传速度限制, 运行时可修改, 默认:0
-max-overall-upload-limit=128K
-# 单个任务上传速度限制, 默认:0
-#@max-upload-limit=0
-# 禁用IPv6, 默认:false
-disable-ipv6=false
-#运行覆盖已存在文件
-#@allow-overwrite=true
-#自动重命名
-#@auto-file-renaming=true
+################ RPC ################
+# Enable JSON-RPC/XML-RPC server.
+enable-rpc=true
+# Add Access-Control-Allow-Origin header field with value * to the RPC response.
+rpc-allow-origin-all=true
+# Listen incoming JSON-RPC/XML-RPC requests on all network interfaces.
+rpc-listen-all=true
-## 进度保存相关 ##
-# 从会话文件中读取下载任务
-#@input-file=/Users/Shared/aria2.session
-# 在Aria2退出时保存`错误/未完成`的下载任务到会话文件
-#@save-session=/Users/Shared/aria2.session
-# 定时保存会话, 0为退出时才保存, 需1.16.1以上版本, 默认:0
-save-session-interval=30
+################ File system ################
+# Save a control file(*.aria2) every SEC seconds.
+auto-save-interval=10
+# Enable disk cache.
+disk-cache=32M
+# Specify file allocation method.
+file-allocation=falloc
+# Save error/unfinished downloads to a file specified by --save-session option every SEC seconds.
+save-session-interval=10
-## RPC相关设置 ##
-# 启用RPC, 默认:false
-enable-rpc=true
-# 允许所有来源, 默认:false
-rpc-allow-origin-all=true
-# 允许非外部访问, 默认:false
-rpc-listen-all=true
-# 事件轮询方式, 取值:[epoll, kqueue, port, poll, select], 不同系统默认值不同
-#event-poll=select
-# RPC监听端口, 端口被占用时可以修改, 默认:6800
-# 使用本客户端请勿修改此项
-# rpc-listen-port=6800
-# 设置的RPC授权令牌, v1.18.4新增功能, 取代 --rpc-user 和 --rpc-passwd 选项
-#rpc-secret=token
+################ Task ################
+# Exclude seed only downloads when counting concurrent active downloads
+bt-detach-seed-only=true
+# Verify the peer using certificates specified in --ca-certificate option.
+check-certificate=false
+# If aria2 receives "file not found" status from the remote HTTP/FTP servers NUM times
+# without getting a single byte, then force the download to fail.
+max-file-not-found=5
+# Set number of tries.
+max-tries=5
+# aria2 does not split less than 2*SIZE byte range.
+min-split-size=1M
+# Set user agent for HTTP(S) downloads.
+user-agent=Transmission/2.94
-## BT/PT下载相关 ##
-# 当下载的是一个种子(以.torrent结尾)时, 自动开始BT任务, 默认:true
-#follow-torrent=true
-# BT监听端口, 当端口被屏蔽时使用, 默认:6881-6999
-# listen-port=50101-50109
-# 单个种子最大连接数, 默认:55
+################ BT Task ################
+# Enable Local Peer Discovery.
+bt-enable-lpd=true
+# Requires BitTorrent message payload encryption with arc4.
+bt-force-encryption=true
+# If true is given, after hash check using --check-integrity option and file is complete, continue to seed file.
+bt-hash-check-seed=true
+# Specify the maximum number of peers per torrent.
bt-max-peers=255
-# 打开DHT功能, PT需要禁用, 默认:true
-enable-dht=true
-# 打开IPv6 DHT功能, PT需要禁用
-enable-dht6=true
-# DHT网络监听端口, 默认:6881-6999
-# dht-listen-port=50101-50109
+# Removes the unselected files when download is completed in BitTorrent.
+bt-remove-unselected-file=true
+# Seed previously downloaded files without verifying piece hashes.
+bt-seed-unverified=true
# Set host and port as an entry point to IPv4 DHT network.
dht-entry-point=dht.transmissionbt.com:6881
# Set host and port as an entry point to IPv6 DHT network.
dht-entry-point6=dht.transmissionbt.com:6881
-# 本地节点查找, PT需要禁用, 默认:false
-bt-enable-lpd=true
-# 种子交换, PT需要禁用, 默认:true
+# Enable IPv4 DHT functionality. It also enables UDP tracker support.
+enable-dht=true
+# Enable IPv6 DHT functionality.
+enable-dht6=true
+# Enable Peer Exchange extension.
enable-peer-exchange=true
-# 每个种子限速, 对少种的PT很有用, 默认:50K
-#bt-request-peer-speed-limit=50K
-# 客户端伪装, PT需要
-peer-id-prefix=-TR2940-
+# Specify the string used during the bitorrent extended handshake for the peer's client version.
peer-agent=Transmission/2.94
-user-agent=Transmission/2.94
-# 当种子的分享率达到这个数时, 自动停止做种, 0为一直做种, 默认:1.0
-# seed-ratio=1.0
-# 强制保存会话, 即使任务已经完成, 默认:false
-# 较新的版本开启后会在任务完成后依然保留.aria2文件
-#force-save=false
-# BT校验相关, 默认:true
-#bt-hash-check-seed=true
-# 继续之前的BT任务时, 无需再次校验, 默认:false
-bt-seed-unverified=true
-# 保存磁力链接元数据为种子文件(.torrent文件), 默认:false
-bt-save-metadata=false
-# Removes the unselected files when download is completed in BitTorrent.
-# To select files, use --select-file option. If it is not used,
-# all files are assumed to be selected. Please use this option with care
-# because it will actually remove files from your disk. Default: false
-bt-remove-unselected-file=true
-# Verify the peer using certificates specified
-# in --ca-certificate option. Default: true
-check-certificate=false
-# Exclude seed only downloads when counting concurrent active downloads (See -j option).
-# This means that if -j3 is given and this option is turned on and 3 downloads are active and one of those enters seed mode,
-# then it is excluded from active download count (thus it becomes 2),
-# and the next download waiting in queue gets started.
-# But be aware that seeding item is still recognized as active download in RPC method. Default: false
-bt-detach-seed-only=true
+# Specify the prefix of peer ID.
+peer-id-prefix=-TR2940-
diff --git a/extra/linux/engine/aria2.conf b/extra/linux/engine/aria2.conf
old mode 100755
new mode 100644
index fbf8bfc9..c124eaf8
--- a/extra/linux/engine/aria2.conf
+++ b/extra/linux/engine/aria2.conf
@@ -1,123 +1,71 @@
-## '#'开头为注释内容, 选项都有相应的注释说明, 根据需要修改 ##
-## 被注释的选项填写的是默认值, 建议在需要修改时再取消注释 ##
-## 添加了@和默认启用的选项都是系统需要调用的,请不要随意改动否则可能无法正常运行
+###############################
+# Motrix Linux Aria2 config file
+#
+# @see https://aria2.github.io/manual/en/html/aria2c.html
+#
+###############################
-## 文件保存相关 ##
-# 文件的保存路径(可使用绝对路径或相对路径), 默认: 当前启动位置
-# 此项 OS X 无法使用 $HOME 及 ~/ 设置路径 建议使用 /users/用户名/downloads
-#@dir=$HOME/downloads
-# 启用磁盘缓存, 0为禁用缓存, 需1.16以上版本, 默认:16M
-#@disk-cache=32M
-# 文件预分配方式, 能有效降低磁盘碎片, 默认:prealloc
-# 预分配所需时间: none < falloc ? trunc < prealloc
-# falloc和trunc则需要文件系统和内核支持
-# NTFS建议使用falloc, EXT3/4建议trunc, MAC 下需要注释此项
-file-allocation=trunc
-# 断点续传
-#@continue=true
-
-## 下载连接相关 ##
-
-# 最大同时下载任务数, 运行时可修改, 默认:5
-#@max-concurrent-downloads=10
-# 同一服务器连接数, 添加时可指定, 默认:1
-#@max-connection-per-server=15
-# 最小文件分片大小, 添加时可指定, 取值范围1M -1024M, 默认:20M
-# 假定size=10M, 文件为20MiB 则使用两个来源下载; 文件为15MiB 则使用一个来源下载
-#@min-split-size=10M
-# 单个任务最大线程数, 添加时可指定, 默认:5
-#@split=15
-# 整体下载速度限制, 运行时可修改, 默认:0
-#@max-overall-download-limit=0
-# 单个任务下载速度限制, 默认:0
-#@max-download-limit=0
-# 整体上传速度限制, 运行时可修改, 默认:0
-max-overall-upload-limit=128K
-# 单个任务上传速度限制, 默认:0
-#@max-upload-limit=0
-# 禁用IPv6, 默认:false
-disable-ipv6=false
-#运行覆盖已存在文件
-#@allow-overwrite=true
-#自动重命名
-#@auto-file-renaming=true
+################ RPC ################
+# Enable JSON-RPC/XML-RPC server.
+enable-rpc=true
+# Add Access-Control-Allow-Origin header field with value * to the RPC response.
+rpc-allow-origin-all=true
+# Listen incoming JSON-RPC/XML-RPC requests on all network interfaces.
+rpc-listen-all=true
-## 进度保存相关 ##
-# 从会话文件中读取下载任务
-#@input-file=/Users/Shared/aria2.session
-# 在Aria2退出时保存`错误/未完成`的下载任务到会话文件
-#@save-session=/Users/Shared/aria2.session
-# 定时保存会话, 0为退出时才保存, 需1.16.1以上版本, 默认:0
-save-session-interval=30
+################ File system ################
+# Save a control file(*.aria2) every SEC seconds.
+auto-save-interval=10
+# Enable disk cache.
+disk-cache=32M
+# Specify file allocation method.
+file-allocation=trunc
+# Save error/unfinished downloads to a file specified by --save-session option every SEC seconds.
+save-session-interval=10
-## RPC相关设置 ##
-# 启用RPC, 默认:false
-enable-rpc=true
-# 允许所有来源, 默认:false
-rpc-allow-origin-all=true
-# 允许非外部访问, 默认:false
-rpc-listen-all=true
-# 事件轮询方式, 取值:[epoll, kqueue, port, poll, select], 不同系统默认值不同
-#event-poll=select
-# RPC监听端口, 端口被占用时可以修改, 默认:6800
-# 使用本客户端请勿修改此项
-# rpc-listen-port=6800
-# 设置的RPC授权令牌, v1.18.4新增功能, 取代 --rpc-user 和 --rpc-passwd 选项
-#rpc-secret=token
+################ Task ################
+# Exclude seed only downloads when counting concurrent active downloads
+bt-detach-seed-only=true
+# Verify the peer using certificates specified in --ca-certificate option.
+check-certificate=false
+# If aria2 receives "file not found" status from the remote HTTP/FTP servers NUM times
+# without getting a single byte, then force the download to fail.
+max-file-not-found=5
+# Set number of tries.
+max-tries=5
+# aria2 does not split less than 2*SIZE byte range.
+min-split-size=1M
+# Set user agent for HTTP(S) downloads.
+user-agent=Transmission/2.94
-## BT/PT下载相关 ##
-# 当下载的是一个种子(以.torrent结尾)时, 自动开始BT任务, 默认:true
-#follow-torrent=true
-# BT监听端口, 当端口被屏蔽时使用, 默认:6881-6999
-# listen-port=50101-50109
-# 单个种子最大连接数, 默认:55
+################ BT Task ################
+# Enable Local Peer Discovery.
+bt-enable-lpd=true
+# Requires BitTorrent message payload encryption with arc4.
+bt-force-encryption=true
+# If true is given, after hash check using --check-integrity option and file is complete, continue to seed file.
+bt-hash-check-seed=true
+# Specify the maximum number of peers per torrent.
bt-max-peers=255
-# 打开DHT功能, PT需要禁用, 默认:true
-enable-dht=true
-# 打开IPv6 DHT功能, PT需要禁用
-enable-dht6=true
-# DHT网络监听端口, 默认:6881-6999
-# dht-listen-port=50101-50109
+# Removes the unselected files when download is completed in BitTorrent.
+bt-remove-unselected-file=true
+# Seed previously downloaded files without verifying piece hashes.
+bt-seed-unverified=true
# Set host and port as an entry point to IPv4 DHT network.
dht-entry-point=dht.transmissionbt.com:6881
# Set host and port as an entry point to IPv6 DHT network.
dht-entry-point6=dht.transmissionbt.com:6881
-# 本地节点查找, PT需要禁用, 默认:false
-bt-enable-lpd=true
-# 种子交换, PT需要禁用, 默认:true
+# Enable IPv4 DHT functionality. It also enables UDP tracker support.
+enable-dht=true
+# Enable IPv6 DHT functionality.
+enable-dht6=true
+# Enable Peer Exchange extension.
enable-peer-exchange=true
-# 每个种子限速, 对少种的PT很有用, 默认:50K
-#bt-request-peer-speed-limit=50K
-# 客户端伪装, PT需要
-peer-id-prefix=-TR2940-
+# Specify the string used during the bitorrent extended handshake for the peer's client version.
peer-agent=Transmission/2.94
-user-agent=Transmission/2.94
-# 当种子的分享率达到这个数时, 自动停止做种, 0为一直做种, 默认:1.0
-# seed-ratio=1.0
-# 强制保存会话, 即使任务已经完成, 默认:false
-# 较新的版本开启后会在任务完成后依然保留.aria2文件
-#force-save=false
-# BT校验相关, 默认:true
-#bt-hash-check-seed=true
-# 继续之前的BT任务时, 无需再次校验, 默认:false
-bt-seed-unverified=true
-# 保存磁力链接元数据为种子文件(.torrent文件), 默认:false
-bt-save-metadata=false
-# Removes the unselected files when download is completed in BitTorrent.
-# To select files, use --select-file option. If it is not used,
-# all files are assumed to be selected. Please use this option with care
-# because it will actually remove files from your disk. Default: false
-bt-remove-unselected-file=true
-# Verify the peer using certificates specified
-# in --ca-certificate option. Default: true
-check-certificate=false
-# Exclude seed only downloads when counting concurrent active downloads (See -j option).
-# This means that if -j3 is given and this option is turned on and 3 downloads are active and one of those enters seed mode,
-# then it is excluded from active download count (thus it becomes 2),
-# and the next download waiting in queue gets started.
-# But be aware that seeding item is still recognized as active download in RPC method. Default: false
-bt-detach-seed-only=true
+# Specify the prefix of peer ID.
+peer-id-prefix=-TR2940-
diff --git a/extra/win32/engine/aria2.conf b/extra/win32/engine/aria2.conf
old mode 100755
new mode 100644
index 5f20c8ee..a17f93a3
--- a/extra/win32/engine/aria2.conf
+++ b/extra/win32/engine/aria2.conf
@@ -1,123 +1,71 @@
-## '#'开头为注释内容, 选项都有相应的注释说明, 根据需要修改 ##
-## 被注释的选项填写的是默认值, 建议在需要修改时再取消注释 ##
-## 添加了@和默认启用的选项都是系统需要调用的,请不要随意改动否则可能无法正常运行
+###############################
+# Motrix Windows Aria2 config file
+#
+# @see https://aria2.github.io/manual/en/html/aria2c.html
+#
+###############################
-## 文件保存相关 ##
-# 文件的保存路径(可使用绝对路径或相对路径), 默认: 当前启动位置
-# 此项 OS X 无法使用 $HOME 及 ~/ 设置路径 建议使用 /users/用户名/downloads
-#@dir=$HOME/downloads
-# 启用磁盘缓存, 0为禁用缓存, 需1.16以上版本, 默认:16M
-#@disk-cache=32M
-# 文件预分配方式, 能有效降低磁盘碎片, 默认:prealloc
-# 预分配所需时间: none < falloc ? trunc < prealloc
-# falloc和trunc则需要文件系统和内核支持
-# NTFS建议使用falloc, EXT3/4建议trunc, MAC 下需要注释此项
-file-allocation=falloc
-# 断点续传
-#@continue=true
-
-## 下载连接相关 ##
-
-# 最大同时下载任务数, 运行时可修改, 默认:5
-#@max-concurrent-downloads=10
-# 同一服务器连接数, 添加时可指定, 默认:1
-#@max-connection-per-server=15
-# 最小文件分片大小, 添加时可指定, 取值范围1M -1024M, 默认:20M
-# 假定size=10M, 文件为20MiB 则使用两个来源下载; 文件为15MiB 则使用一个来源下载
-#@min-split-size=10M
-# 单个任务最大线程数, 添加时可指定, 默认:5
-#@split=15
-# 整体下载速度限制, 运行时可修改, 默认:0
-#@max-overall-download-limit=0
-# 单个任务下载速度限制, 默认:0
-#@max-download-limit=0
-# 整体上传速度限制, 运行时可修改, 默认:0
-max-overall-upload-limit=128K
-# 单个任务上传速度限制, 默认:0
-#@max-upload-limit=0
-# 禁用IPv6, 默认:false
-disable-ipv6=false
-#运行覆盖已存在文件
-#@allow-overwrite=true
-#自动重命名
-#@auto-file-renaming=true
+################ RPC ################
+# Enable JSON-RPC/XML-RPC server.
+enable-rpc=true
+# Add Access-Control-Allow-Origin header field with value * to the RPC response.
+rpc-allow-origin-all=true
+# Listen incoming JSON-RPC/XML-RPC requests on all network interfaces.
+rpc-listen-all=true
-## 进度保存相关 ##
-# 从会话文件中读取下载任务
-#@input-file=/Users/Shared/aria2.session
-# 在Aria2退出时保存`错误/未完成`的下载任务到会话文件
-#@save-session=/Users/Shared/aria2.session
-# 定时保存会话, 0为退出时才保存, 需1.16.1以上版本, 默认:0
-save-session-interval=30
+################ File system ################
+# Save a control file(*.aria2) every SEC seconds.
+auto-save-interval=10
+# Enable disk cache.
+disk-cache=32M
+# Specify file allocation method.
+file-allocation=falloc
+# Save error/unfinished downloads to a file specified by --save-session option every SEC seconds.
+save-session-interval=10
-## RPC相关设置 ##
-# 启用RPC, 默认:false
-enable-rpc=true
-# 允许所有来源, 默认:false
-rpc-allow-origin-all=true
-# 允许非外部访问, 默认:false
-rpc-listen-all=true
-# 事件轮询方式, 取值:[epoll, kqueue, port, poll, select], 不同系统默认值不同
-#event-poll=select
-# RPC监听端口, 端口被占用时可以修改, 默认:6800
-# 使用本客户端请勿修改此项
-# rpc-listen-port=6800
-# 设置的RPC授权令牌, v1.18.4新增功能, 取代 --rpc-user 和 --rpc-passwd 选项
-#rpc-secret=token
+################ Task ################
+# Exclude seed only downloads when counting concurrent active downloads
+bt-detach-seed-only=true
+# Verify the peer using certificates specified in --ca-certificate option.
+check-certificate=false
+# If aria2 receives "file not found" status from the remote HTTP/FTP servers NUM times
+# without getting a single byte, then force the download to fail.
+max-file-not-found=5
+# Set number of tries.
+max-tries=5
+# aria2 does not split less than 2*SIZE byte range.
+min-split-size=1M
+# Set user agent for HTTP(S) downloads.
+user-agent=Transmission/2.94
-## BT/PT下载相关 ##
-# 当下载的是一个种子(以.torrent结尾)时, 自动开始BT任务, 默认:true
-#follow-torrent=true
-# BT监听端口, 当端口被屏蔽时使用, 默认:6881-6999
-# listen-port=50101-50109
-# 单个种子最大连接数, 默认:55
+################ BT Task ################
+# Enable Local Peer Discovery.
+bt-enable-lpd=true
+# Requires BitTorrent message payload encryption with arc4.
+bt-force-encryption=true
+# If true is given, after hash check using --check-integrity option and file is complete, continue to seed file.
+bt-hash-check-seed=true
+# Specify the maximum number of peers per torrent.
bt-max-peers=255
-# 打开DHT功能, PT需要禁用, 默认:true
-enable-dht=true
-# 打开IPv6 DHT功能, PT需要禁用
-enable-dht6=true
-# DHT网络监听端口, 默认:6881-6999
-# dht-listen-port=50101-50109
+# Removes the unselected files when download is completed in BitTorrent.
+bt-remove-unselected-file=true
+# Seed previously downloaded files without verifying piece hashes.
+bt-seed-unverified=true
# Set host and port as an entry point to IPv4 DHT network.
dht-entry-point=dht.transmissionbt.com:6881
# Set host and port as an entry point to IPv6 DHT network.
dht-entry-point6=dht.transmissionbt.com:6881
-# 本地节点查找, PT需要禁用, 默认:false
-bt-enable-lpd=true
-# 种子交换, PT需要禁用, 默认:true
+# Enable IPv4 DHT functionality. It also enables UDP tracker support.
+enable-dht=true
+# Enable IPv6 DHT functionality.
+enable-dht6=true
+# Enable Peer Exchange extension.
enable-peer-exchange=true
-# 每个种子限速, 对少种的PT很有用, 默认:50K
-#bt-request-peer-speed-limit=50K
-# 客户端伪装, PT需要
-peer-id-prefix=-TR2940-
+# Specify the string used during the bitorrent extended handshake for the peer's client version.
peer-agent=Transmission/2.94
-user-agent=Transmission/2.94
-# 当种子的分享率达到这个数时, 自动停止做种, 0为一直做种, 默认:1.0
-# seed-ratio=1.0
-# 强制保存会话, 即使任务已经完成, 默认:false
-# 较新的版本开启后会在任务完成后依然保留.aria2文件
-#force-save=false
-# BT校验相关, 默认:true
-#bt-hash-check-seed=true
-# 继续之前的BT任务时, 无需再次校验, 默认:false
-bt-seed-unverified=true
-# 保存磁力链接元数据为种子文件(.torrent文件), 默认:false
-bt-save-metadata=false
-# Removes the unselected files when download is completed in BitTorrent.
-# To select files, use --select-file option. If it is not used,
-# all files are assumed to be selected. Please use this option with care
-# because it will actually remove files from your disk. Default: false
-bt-remove-unselected-file=true
-# Verify the peer using certificates specified
-# in --ca-certificate option. Default: true
-check-certificate=false
-# Exclude seed only downloads when counting concurrent active downloads (See -j option).
-# This means that if -j3 is given and this option is turned on and 3 downloads are active and one of those enters seed mode,
-# then it is excluded from active download count (thus it becomes 2),
-# and the next download waiting in queue gets started.
-# But be aware that seeding item is still recognized as active download in RPC method. Default: false
-bt-detach-seed-only=true
+# Specify the prefix of peer ID.
+peer-id-prefix=-TR2940-