描述:Aria2简介Aria2 完美配置是一套 Aria2 配置方案,包含了配置文件、附加功能脚本等文件,用于实现 Aria2 功能的增强和扩展,提升 Aria2 的下载速度与使用体验,解决 Aria2 在使用中遇到的 BT 下载无速度、文件残留占用磁盘空间、任务丢失、重复下载等问题。功能特性BT下载率高…
Aria2 完美配置是一套 Aria2 配置方案,包含了配置文件、附加功能脚本等文件,用于实现 Aria2 功能的增强和扩展,提升 Aria2 的下载速度与使用体验,解决 Aria2 在使用中遇到的 BT 下载无速度、文件残留占用磁盘空间、任务丢失、重复下载等问题。
为了确保能正常使用,请先安装基础组件wget、curl、ca-certificates,以 Debian/centos为例子:
<span class="hljs-attribute">apt</span> install wget curl ca-certificates <span class="hljs-comment">#debian</span>yum install wget curl ca-certificates <span class="hljs-comment">#centos</span><span class="hljs-attribute">apt</span> install wget curl ca-certificates <span class="hljs-comment">#debian</span> yum install wget curl ca-certificates <span class="hljs-comment">#centos</span>apt install wget curl ca-certificates#debianyum install wget curl ca-certificates #centos
<span class="hljs-attribute">wget</span> -N git.io/aria2.sh && chmod +x aria2.sh<span class="hljs-attribute">wget</span> -N git.io/aria2.sh && chmod +x aria2.shwget -N git.io/aria2.sh && chmod +x aria2.sh
Aria2项目GITHUB:
./aria2.sh./aria2.sh./aria2.sh
Aria2 一键安装管理脚本 增强版 [v2<span class="hljs-number">.7</span><span class="hljs-number">.4</span>] <span class="hljs-keyword">by</span> P3TERX.COM<span class="hljs-number">0.</span> 升级脚本———————————————————————<span class="hljs-number">1.</span> 安装 Aria2<span class="hljs-number">2.</span> 更新 Aria2<span class="hljs-number">3.</span> 卸载 Aria2———————————————————————<span class="hljs-number">4.</span> 启动 Aria2<span class="hljs-number">5.</span> 停止 Aria2<span class="hljs-number">6.</span> 重启 Aria2———————————————————————<span class="hljs-number">7.</span> 修改 配置<span class="hljs-number">8.</span> 查看 配置<span class="hljs-number">9.</span> 查看 日志<span class="hljs-number">10.</span> 清空 日志———————————————————————<span class="hljs-number">11.</span> 手动更新 BT-Tracker<span class="hljs-number">12.</span> 自动更新 BT-Tracker———————————————————————Aria2 状态: 已安装 | 已启动自动更新 BT-Tracker: 已开启请输入数字 [<span class="hljs-number">0</span><span class="hljs-number">-12</span>]:Aria2 一键安装管理脚本 增强版 [v2<span class="hljs-number">.7</span><span class="hljs-number">.4</span>] <span class="hljs-keyword">by</span> P3TERX.COM <span class="hljs-number">0.</span> 升级脚本 ——————————————————————— <span class="hljs-number">1.</span> 安装 Aria2 <span class="hljs-number">2.</span> 更新 Aria2 <span class="hljs-number">3.</span> 卸载 Aria2 ——————————————————————— <span class="hljs-number">4.</span> 启动 Aria2 <span class="hljs-number">5.</span> 停止 Aria2 <span class="hljs-number">6.</span> 重启 Aria2 ——————————————————————— <span class="hljs-number">7.</span> 修改 配置 <span class="hljs-number">8.</span> 查看 配置 <span class="hljs-number">9.</span> 查看 日志 <span class="hljs-number">10.</span> 清空 日志 ——————————————————————— <span class="hljs-number">11.</span> 手动更新 BT-Tracker <span class="hljs-number">12.</span> 自动更新 BT-Tracker ——————————————————————— Aria2 状态: 已安装 | 已启动 自动更新 BT-Tracker: 已开启 请输入数字 [<span class="hljs-number">0</span><span class="hljs-number">-12</span>]:Aria2 一键安装管理脚本 增强版 [v2.7.4] by P3TERX.COM0. 升级脚本 ———————————————————————1. 安装 Aria22. 更新 Aria23. 卸载 Aria2 ———————————————————————4. 启动 Aria25. 停止 Aria26. 重启 Aria2 ———————————————————————7. 修改 配置8. 查看 配置9. 查看 日志 10. 清空 日志 ——————————————————————— 11. 手动更新 BT-Tracker 12. 自动更新 BT-Tracker ———————————————————————Aria2 状态: 已安装 | 已启动自动更新 BT-Tracker: 已开启请输入数字 [0-12]:
Aria2 简单配置信息:IPv4 地址 : <span class="hljs-emphasis">*.*</span>.<span class="hljs-emphasis">*.*</span>IPv6 地址 : IPv6 地址检测失败RPC 端口 : 6800RPC 密钥 : 122sd1111123456df42下载目录 : /root/downloadsAriaNg 链接 : http://ariang.js.org/#!/settings/rpc/set/ws/<span class="hljs-emphasis">*.*</span>.<span class="hljs-emphasis">*.*</span>/6800/jsonrpc/ZjFdfkdikDAmNDI=Aria2 简单配置信息: IPv4 地址 : <span class="hljs-emphasis">*.*</span>.<span class="hljs-emphasis">*.*</span> IPv6 地址 : IPv6 地址检测失败 RPC 端口 : 6800 RPC 密钥 : 122sd1111123456df42 下载目录 : /root/downloads AriaNg 链接 : http://ariang.js.org/#!/settings/rpc/set/ws/<span class="hljs-emphasis">*.*</span>.<span class="hljs-emphasis">*.*</span>/6800/jsonrpc/ZjFdfkdikDAmNDI=Aria2 简单配置信息: IPv4 地址: *.*.*.* IPv6 地址: IPv6 地址检测失败 RPC 端口: 6800 RPC 密钥: 122sd1111123456df42 下载目录: /root/downloads AriaNg 链接: http://ariang.js.org/#!/settings/rpc/set/ws/*.*.*.*/6800/jsonrpc/ZjFdfkdikDAmNDI=
Aria2 默认已经自带了Aria2NG了,打开:http://ariang.js.org/#xxxx那一串地址,就可以进入Aria2 离线下载界面了。
| 文件 | 说明 |
| aria2.conf | Aria2 配置文件。仅适用于 Aria2 1.35.0 及以上版本,在不了解的情况下修改可能导致本方案的特性失效。 |
| delete.sh | 文件删除脚本。在下载停止后执行(on-download-stop),自动删除文件及 .aria2 后缀名文件,防止不必要的磁盘空间占用。(默认启用) |
| clean.sh | 清理脚本。在下载完成后执行(on-download-complete),自动清除 .aria2 后缀名文件。(默认启用) |
| upload.sh | 上传脚本。在下载完成后执行(on-download-complete),自动调用 RCLONE 上传(move)下载的文件到网盘,并自动清除 .aria2 后缀名文件与空目录。(默认不启用) |
| move.sh | 文件移动脚本。在下载完成后执行(on-download-complete),自动将下载完成的文件移动到指定目录,并自动清除 .aria2 后缀名文件与空目录。(默认不启用) |
| tracker.sh | BT tracker 列表更新脚本。在 Aria2 配置文件(aria2.conf)所在目录执行即可获取最新 tracker 列表并添加到配置文件中。此脚本还有更强大的功能,具体使用方法详见 tracker.md |
| dht.dat dht6.dat | DHT 文件。提升 BT 下载率和下载速度的关键之一。相关科普:《解决 Aria2 无法下载磁力链接、BT种子和速度慢的问题》 |
Aria2 一键安装管理脚本 增强版 整合了 Aria2 完美配置 ,安装后会附带一些附加功能脚本功能脚本,RCLONE 自动上传脚本就是其中之一。由于默认不启用,所以需要手动启用。
TIPS: 本项目的上传脚本使用更稳定快速的原生命令上传方式,而非处在测试阶段的挂载方式,这点和一般的脚本不同。
输入以下命令打开 Aria2 配置文件进行修改
nano <span class="hljs-regexp">/root/</span>.aria2c/aria2.confnano <span class="hljs-regexp">/root/</span>.aria2c/aria2.confnano /root/.aria2c/aria2.conf
或使用Aria2 一键安装管理脚本 增强版中的手动修改选项打开配置文件进行修改。找到“下载完成后执行的命令”,把clean.sh替换为upload.sh。
<span class="hljs-literal">on</span>-download-complete=<span class="hljs-regexp">/root/</span>.aria2c/upload.sh<span class="hljs-literal">on</span>-download-complete=<span class="hljs-regexp">/root/</span>.aria2c/upload.shon-download-complete=/root/.aria2c/upload.sh
nano 编辑器的操作方法参见《Linux 下适合新手的文本编辑器 nano 使用教程》
输入以下命令打开附加功能脚本配置文件进行修改
nano <span class="hljs-regexp">/root/</span>.aria2c/script.confnano <span class="hljs-regexp">/root/</span>.aria2c/script.confnano /root/.aria2c/script.conf
有中文注释,按照自己的实际情况进行修改,第一次使用只建议修改网盘名称。
<span class="hljs-attr">drive-name</span>=remote<span class="hljs-attr">drive-name</span>=remotedrive-name=remote
重启 Aria2 。脚本选项重启或者执行以下命令:
<span class="hljs-attribute">service</span> aria2 restart<span class="hljs-attribute">service</span> aria2 restartservice aria2 restart
执行upload.sh脚本,提示success即代上传脚本能正常被调用,否则请检查与 RCLONE 有关的配置。
<span class="hljs-attribute">wget</span> -N git.io/aria2.sh && chmod +x aria2.sh<span class="hljs-attribute">wget</span> -N git.io/aria2.sh && chmod +x aria2.sh0/root/.aria2c/upload.sh
打开实时日志并下载任意文件,出现上传成功信息即代表配置成功,否则请认真阅读教程并重新开始。
检查网盘是否存在相关文件,若不存在说明你搞错网盘了。
Rclone是一个的命令行工具,支持在不同对象存储、网盘间同步、上传、下载数据。并且通过一些设置可以实现离线下载、服务器备份等非常实用的功能。这里以 OneDrive 和 Google Drive 为例子,进行连接配置,其它网盘的操作类似。由于是交互式配置选项,只要能看懂基本没有任何难度。
RCLONE 官方提供了一键安装脚本:
<span class="hljs-attribute">wget</span> -N git.io/aria2.sh && chmod +x aria2.sh<span class="hljs-attribute">wget</span> -N git.io/aria2.sh && chmod +x aria2.sh1curl https://rclone.org/install.sh | sudo bash
在本地Windows电脑上下载rclone win版,然后解压出来,解压后进入文件夹,在资源管理器地址栏输入cmd,回车就会在当前路径打开命令提示符。输入以下命令:
<span class="hljs-attribute">wget</span> -N git.io/aria2.sh && chmod +x aria2.sh<span class="hljs-attribute">wget</span> -N git.io/aria2.sh && chmod +x aria2.sh2rclone authorize "onedrive"
接下来会弹出浏览器,要求你登录账号进行授权。授权完后命令提示符窗口会出现以下信息:
<span class="hljs-attribute">wget</span> -N git.io/aria2.sh && chmod +x aria2.sh<span class="hljs-attribute">wget</span> -N git.io/aria2.sh && chmod +x aria2.sh3If your browser doesnt open automatically go to the following link: http://127.0.0.1:53682/authLog in and authorize rclone for accessWaiting for code...Got codePaste the following into your remote machine --->{"access_token":"xxxxxxxx"}# 注意!复制{xxxxxxxx}整个内容,并保存好,后面需要用到<---End paste
输入以下命令
<span class="hljs-attribute">wget</span> -N git.io/aria2.sh && chmod +x aria2.sh<span class="hljs-attribute">wget</span> -N git.io/aria2.sh && chmod +x aria2.sh4rclone config
会出现以下信息,参照下面的注释进行操作。
TIPS: 因为 RCLONE 会时不时进行更新,当你看到这篇教程时菜单选项可能已经发生了略微的改动,但大致思路不会变,不要无脑照搬操作。
<span class="hljs-attribute">wget</span> -N git.io/aria2.sh && chmod +x aria2.sh<span class="hljs-attribute">wget</span> -N git.io/aria2.sh && chmod +x aria2.sh5e) Edit existing remoten) New remoted) Delete remoter) Rename remotec) Copy remotes) Set configuration passwordq) Quit confige/n/d/r/c/s/q> n# 选择n,新建name> remote# 输入名称,类似于标签,用于区分不同的网盘。Type of storage to configure.Enter a string value. Press Enter for the default ("").Choose a number from below, or type in your own value[snip]XX / Microsoft OneDrive"onedrive"[snip]Storage>XX# 选择Microsoft OneDrive对应的数字Microsoft App Client IdLeave blank normally.Enter a string value. Press Enter for the default ("").client_id># 留空,回车Microsoft App Client SecretLeave blank normally.Enter a string value. Press Enter for the default ("").client_secret># 留空,回车Edit advanced config? (y/n)y) Yesn) Noy/n> n# 选nRemote configUse auto config? * Say Y if not sure * Say N if you are working on a remote or headless machiney) Yesn) Noy/n> n# 选nFor this to work, you will need rclone available on a machine that has a web browser available.Execute the following on your machine:rclone authorize "onedrive"Then paste the result below:result> {"XXXXXXXX"}# 复制上面Win下获取的token值到这里Choose a number from below, or type in an existing value 1 / OneDrive Personal or Business"onedrive" 2 / Sharepoint site"sharepoint" 3 / Type in driveID"driveid" 4 / Type in SiteID"siteid" 5 / Search a Sharepoint site"search"Your choice> 1# 这里问你要选择的类型,选1Found 1 drives, please select the one you want to use:0: OneDrive (business) id=b!Eqwertyuiopasdfghjklzxcvbnm-7mnbvcxzlkjhgfdsapoiuytrewqkChose drive to use:> 0# 程序找到网盘,编号是什么数字就填什么数字,一般是0Found drive root of type business, URL: https://org-my.sharepoint.com/personal/you/DocumentsIs that okay?y) Yesn) Noy/n> y--------------------[remote]type = onedrivetoken = {"access_token":"youraccesstoken","token_type":"Bearer","refresh_token":"yourrefreshtoken","expiry":"2021-12-07T09:39:52.486512262+08:00"}drive_id = b!Eqwertyuiopasdfghjklzxcvbnm-7mnbvcxzlkjhgfdsapoiuytrewqkdrive_type = business--------------------y) Yes this is OKe) Edit this remoted) Delete this remotey/e/d> y# 选yCurrent remotes:NameType========remoteonedrivee) Edit existing remoten) New remoted) Delete remoter) Rename remotec) Copy remotes) Set configuration passwordq) Quit confige/n/d/r/c/s/q> q# 选q,退出
至此,Rclone 已成功连接到了 OneDrive 网盘。
与 OneDrive 不同的是,Google Drive 不需要本地 Windows 客户端预先进行授权获取 token,而是在配置过程中进行授权。
输入以下命令
<span class="hljs-attribute">wget</span> -N git.io/aria2.sh && chmod +x aria2.sh<span class="hljs-attribute">wget</span> -N git.io/aria2.sh && chmod +x aria2.sh4rclone config
会出现以下信息,参照下面的注释进行操作。
TIPS: 因为 RCLONE 会时不时进行更新,当你看到这篇教程时菜单选项可能已经发生了略微的改动,但大致思路不会变,不要无脑照搬操作。
<span class="hljs-attribute">wget</span> -N git.io/aria2.sh && chmod +x aria2.sh<span class="hljs-attribute">wget</span> -N git.io/aria2.sh && chmod +x aria2.sh7No remotes found - make a new onen) New remoter) Rename remotec) Copy remotes) Set configuration passwordq) Quit confign/r/c/s/q>n# 选择n,新建name> Google# 输入名称,类似于标签,用于区分不同的网盘。Type of storage to configure.Choose a number from below, or type in your own value[snip]XX / Google Drive"drive"[snip]Storage>XX# 选择Google Drive对应的数字Google Application Client Id - leave blank normally.client_id># 留空,回车Google Application Client Secret - leave blank normally.client_secret># 留空,回车Scope that rclone should use when requesting access from drive.Choose a number from below, or type in your own value 1 / Full access all files, excluding Application Data Folder."drive" 2 / Read-only access to file metadata and file contents."drive.readonly"/ Access to files created by rclone only. 3 | These are visible in the drive website.| File authorization is revoked when the user deauthorizes the app."drive.file"/ Allows read and write access to the Application Data folder. 4 | This is not visible in the drive website."drive.appfolder"/ Allows read-only access to file metadata but 5 | does not allow any access to read or download file content."drive.metadata.readonly"scope> 1# 选择1ID of the root folder - leave blank normally.Fill in to access "Computers" folders. (see docs).root_folder_id># 留空,回车Service Account Credentials JSON file path - needed only if you want use SA instead of interactive login.service_account_file># 留空,回车Remote configUse auto config? * Say Y if not sure * Say N if you are working on a remote or headless machine or Y didnt worky) Yesn) Noy/n>n# 选nIf your browser doesnt open automatically go to the following link: http://127.0.0.1:53682/authLog in and authorize rclone for accessWaiting for code...Got codeConfigure this as a Shared Drive (Team Drive)?y) Yesn) Noy/n> y# 选n--------------------[remote]client_id = client_secret = scope = driveroot_folder_id = service_account_file =token = {"access_token":"XXX","token_type":"Bearer","refresh_token":"XXX","expiry":"2014-03-16T13:57:58.955387075Z"}--------------------y) Yes this is OKe) Edit this remoted) Delete this remotey/e/d> yCurrent remotes:NameType========Googledriveremoteonedrivee) Edit existing remoten) New remoted) Delete remoter) Rename remotec) Copy remotes) Set configuration passwordq) Quit confige/n/d/r/c/s/q> q
至此,Rclone 已成功连接到了 Google Drive 网盘。
<span class="hljs-attribute">wget</span> -N git.io/aria2.sh && chmod +x aria2.sh<span class="hljs-attribute">wget</span> -N git.io/aria2.sh && chmod +x aria2.sh8rclone [功能选项] <本地路径> <网盘名称:路径> [参数] [参数] ...
<span class="hljs-attribute">wget</span> -N git.io/aria2.sh && chmod +x aria2.sh<span class="hljs-attribute">wget</span> -N git.io/aria2.sh && chmod +x aria2.sh9rclone [功能选项] <网盘名称:路径> <本地路径> [参数] [参数] ...
./aria2.sh./aria2.sh0rclone [功能选项] <网盘名称:路径> <网盘名称:路径> [参数] [参数] ...
示例:
./aria2.sh./aria2.sh1rclone move -v /files ftp:/files --transfers=1
rclone 有 4 个级别的日志记录,ERROR,NOTICE,INFO 和 DEBUG。默认情况下,rclone 将生成 ERROR 和 NOTICE 级别消息。
使用 --log-file=FILE 选项,rclone 会将 Error,Info 和 Debug 消息以及标准错误重定向到 FILE,这里的 FILE 是你指定的日志文件路径。
另一种方法是使用系统的指向命令,比如:
./aria2.sh./aria2.sh2rclone sync -v Onedrive:/DRIVEX Gdrive:/DRIVEX > "~/DRIVEX.log" 2>&1
比如 --exclude "*.bak"、--filter "- *.bak",排除所有 bak 文件。也可以写作。
比如 --include "*.{png,jpg}"、--filter "+ *.{png,jpg}",包含所有 png 和 jpg 文件,排除其他文件。
--delete-excluded 删除排除的文件。需配合过滤参数使用,否则无效。
目录过滤需要在目录名称后面加上 /,否则会被当做文件进行匹配。以 / 开头只会匹配根目录(指定目录下),否则匹配所目录。这同样适用于文件。
默认大小单位为 kBytes ,但可以使用 k ,M 或 G 后缀。
rclone 中的每个选项都可以通过环境变量设置。环境变量的名称可以通过长选项名称进行转换,删除 -- 前缀,更改 - 为 _,大写并添加前缀 RCLONE_。环境变量的优先级会低于命令行选项,即通过命令行追加相应的选项时会覆盖环境变量设定的值。
比如设置最小上传大小 --min-size 50,使用环境变量是 RCLONE_MIN_SIZE=50。当环境变量设置后,在命令行中使用 --min-size 100,那么此时环境变量的值就会被覆盖。
给Aria2服务器所用的SSL证书往往不支持Aria2所使用的6800端口,而80/443端口还要提供HTTP服务,为此就需要用Nginx来实现同时提供HTTP和Aria2 JSONRPC服务了。
修改Aria2配置文件
./aria2.sh./aria2.sh3#允许所有来源, web界面跨域权限需要rpc-allow-origin-all=false#允许非外部访问rpc-listen-all=false#RPC端口, 仅当默认端口被占用时修改rpc-listen-port=6800
./aria2.sh./aria2.sh4#ARIA2location /jsonrpc {proxy_pass http://localhost:6800/jsonrpc;proxy_redirect off;proxy_set_headerX-Real-IP$remote_addr;proxy_set_headerX-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header Host $host;#以下代码使支持WebSocketproxy_http_version 1.1;proxy_set_header Upgrade $http_upgrade;proxy_set_header Connection "upgrade";}
其中 location /jsonrpc 表示设置好后RPC地址为 //example.com/jsonrpc
这样做还有一个好处,那就是不需要单独为Aria2 RPC服务器设置密码验证了。认证直接靠nginx完成,能见到webui就能连上ARIA2 RPC
pbootcms内核开发的网站模板,该模板适用于微信小程序网站、软件开发网站等企业,当然其他行业也可以做,只需要把文字图片换成其他行业的即可;PC+WAP,同一个后台,数据即时同步,简单适用!附带测试数据!友好的seo,所有页面均都能完全自定义标题/关键词/描述,PHP程序,安全、稳定、快速;用低成…
(PC+WAP)粉色家政服务公司网站模板 月嫂保姆网站源码下载pbootcms内核开发的网站模板,该模板适用于家政服务公司网站、月嫂保姆网站等企业,当然其他行业也可以做,只需要把文字图片换成其他行业的即可;PC+WAP,同一个后台,数据即时同步,简单适用!附带测试数据!友好的seo,所有页…
(PC+WAP)红色火锅加盟网站pbootcms模板 餐饮美食网站源码下载pbootcms内核开发的网站模板,该模板适用于火锅加盟网站、餐饮美食网站等企业,当然其他行业也可以做,只需要把文字图片换成其他行业的即可;PC+WAP,同一个后台,数据即时同步,简单适用!附带测试数据!友好的seo,所有页面…
(PC+WAP)绿色草坪地坪施工pbootcms网站模板 操场人造草坪网站源码下载pbootcms内核开发的网站模板,该模板适用于人造草坪网站、草坪地坪网站等企业,当然其他行业也可以做,只需要把文字图片换成其他行业的即可;PC+WAP,同一个后台,数据即时同步,简单适用!附带测试数据!友好的seo,…
本套织梦模板采用织梦最新内核开发的模板,这款模板使用范围广,不仅仅局限于一类型的企业,政府部门、单位机构类的网站都可以用该模板。你只需要把图片和文章内容换成你的即可,颜色都可以修改,改完让你耳目一新的感觉!布局规整,利于用户体验,手工书写DIV+CSS,代码精简。同一个后台管理 三网合一简…
1.更新下载类目的采集 及 导入网站程序:jizhiCMS + 高仿新版某刀资源网模板采集程序:蓝天采集 + 已对接好资源站规则网站图片及蓝天采集规则安装教程在下面⬇⬇⬇⬇⬇⬇⬇ 链接:https:/…