Rat's

Aria2+Rclone+DirectoryLister+Aria2Ng一键安装脚本 for Debian
说明:之前发了个VPS结合Google Drive建立BT离线大网盘教程,参考:利用Aria2+AriaNg+H5...
扫描右侧二维码阅读全文
20
2018/02

Aria2+Rclone+DirectoryLister+Aria2Ng一键安装脚本 for Debian

说明:之前发了个VPS结合Google Drive建立BT离线大网盘教程,参考:利用Aria2+AriaNg+H5ai+Google Drive建立离线BT下载/在线播放/无限空间网盘,鉴于很多小白还是不会,加上H5ai有点浪费流量和api,所以友链博主千影写了个一键脚本,使用更好的DirectoryLister替代了H5ai,并自动添加SSL免费证书,Aria2Ng由于使用SSL后影响面板操作,就单独分开了,所以本脚本需要2个域名,并且下载文件自动上传到Google Drive,重启后自动挂载,添加并自动更新Trackers服务器,期间不需要做任何操作,这里分享下脚本。

截图

请输入图片描述
请输入图片描述
请输入图片描述

更新

【2018.12.21】
优化定时任务步骤,最后不再显示定时任务编辑界面。

【2018.8.17】
修复Aria2无法自动更新Trackers服务器的Bug,并优化脚本步骤信息的提示。

脚本

本脚本适用于Debian 8、9。且需要提前使用2个二级域名解析到VPS服务器。

使用命令:

wget https://www.moerats.com/usr/shell/Aria2_Rc_D.sh && bash Aria2_Rc_D.sh

运行脚本后,会依次要你输入以下信息:

#输入网盘域名及Aria2NG面板域名
请输入你的DirectoryLister域名信息:
请输入你的Aria2NG域名信息:

#设置Aria2密钥
请输入你的Aria2密钥:

#配置Rclone,大致如下
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n
name> Rats  #随便填,后面要用到
Type of storage to configure.
Choose a number from below, or type in your own value
 1 / Amazon Drive
   \ "amazon cloud drive"
 2 / Amazon S3 (also Dreamhost, Ceph, Minio)
   \ "s3"
 3 / Backblaze B2
   \ "b2"
 4 / Box
   \ "box"
 5 / Cache a remote
   \ "cache"
 6 / Dropbox
   \ "dropbox"
 7 / Encrypt/Decrypt a remote
   \ "crypt"
 8 / FTP Connection
   \ "ftp"
 9 / Google Cloud Storage (this is not Google Drive)
   \ "google cloud storage"
10 / Google Drive
   \ "drive"
11 / Hubic
   \ "hubic"
12 / Local Disk
   \ "local"
13 / Microsoft Azure Blob Storage
   \ "azureblob"
14 / Microsoft OneDrive
   \ "onedrive"
15 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
   \ "swift"
16 / Pcloud
   \ "pcloud"
17 / QingCloud Object Storage
   \ "qingstor"
18 / SSH/SFTP Connection
   \ "sftp"
19 / Webdav
   \ "webdav"
20 / Yandex Disk
   \ "yandex"
21 / http Connection
   \ "http"
Storage> 10  #选择10,Google Drive,注意该序列号会随时变化,看清楚再填
Google Application Client Id - leave blank normally.
client_id>  #留空 
Google Application Client Secret - leave blank normally.
client_secret>  #留空
Service Account Credentials JSON file path - needed only if you want use SA instead of interactive login.
service_account_file> 
Remote config
Use auto config?
 * Say Y if not sure
 * Say N if you are working on a remote or headless machine or Y didn't work
y) Yes
n) No
y/n> n  #选择n
If your browser doesn't open automatically go to the following link: https://accounts.google.com/o/oauth2/auth....  #复制到浏览器打开,获取验证码
Log in and authorize rclone for access
Enter verification code>  #填入上面获取到的验证码
Configure this as a team drive?
y) Yes
n) No
y/n> y  #选择y
Fetching team drive list...
No team drives found in your account--------------------
[Rats]
client_id = 
client_secret = 
service_account_file = 
token = {"access_token":"ya29.GltFBd7UJN2qrxdG8FnG_rMuB18ogb8QlujdL7glvXtfV"}
team_drive = 
--------------------
y) Yes this is OK
e) Edit this remote
d) Delete this remote
y/e/d> y  #选择y
Current remotes:

Name                 Type
====                 ====
Rats                 drive

e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> q  #选择q退出

#最后输入Name
请输入你刚刚输入的Name:

然后脚本安装完成后,就可以直接通过Aria2Ng面板连接Aria2下载文件,并通过网盘观看了。

相关目录

Aria2下载目录:/root/Download
DirectoryLister目录:/home/wwwroot/a.xx.com
Aria2Ng目录:/home/wwwroot/b.xx.com
挂载目录:/home/wwwroot/a.xx.com/Cloud

千影大佬博客:https://www.94ish.me,欢迎去参观。

Vultr新用户注册送100美元/16个机房按小时计费,支持支付宝,【点击查看】。
最后修改:2020 年 04 月 29 日 01 : 01 PM

发表评论 取消回复

425 条评论

  1. Xiaow

    这个网盘观看要翻Q?

    1. Rat's
      @Xiaow

      不需要

      1. Xiaow
        @Rat's

        不走服务器流量?如果要绑定两个域名怎么操作?比如绑定加www和不加www的

        1. Rat's
          @Xiaow

          这个就需要点基础了,单独不好说

  2. tyon233

    一开始用这个脚本的时候显示The certificate of 'www.moerats.com' is not trusted.也就是未获取证书。这个是本机的问题还是其它的什么问题呀?

    1. Rat's
      @tyon233

      你是mini系统吧?需要安装一个依赖:

      Debian、Ubuntu

      apt install -y ca-certificates

      CentOS

      yum install -y ca-certificates

      1. tyon233
        @Rat's

        原来是这样,我之后试试看。

  3. dorokuma

    大佬~aria2的服务重启以后所有的下载记录都被清空了,没下完的任务都白瞎,咋办呀。。

    1. Rat's
      @dorokuma

      这个问题我还没咋注意,你可以看下Ariang设置啥的,/root/.aria2/aria2.session这个是未完成的会话保存文件。

      1. dorokuma
        @Rat's

        谢谢大佬,我改了conf设置加了从网上搜到的设置项,删掉了.session文件重启让系统重新建立就OK了

        1. Rat's
          @dorokuma

          顺便可以说下方法给其他人参考下。

          1. dorokuma
            @Rat's

            aria2.conf文件里加上save-session-interval=60和force-save=true,保存以后再去删掉aria2.session文件

  4. az

    这个有时候下载多文件会死机啊,是不是我内存太小的缘故(512m)

    1. 无聊死了
      @az

      应该是我的1gb也是这样

    2. az
      @az

      呃,不是死机,是软件自动退出

  5. qtz173

    大佬,这个爱云盘可以添加onedrive吗?
    我试着挂在再文件夹下,可以显示onedrive,但变为一个文件了,无法打开进入

    1. Rat's
      @qtz173

      可以,但建议手动安装。

  6. 王通
    该评论仅登录用户及评论双方可见
    1. Rat's
      @王通

      这个貌似申请证书被限制了,过几天就好了

  7. az

    大佬,这爱云盘的文件是存在GD的吧?那为啥不用代理就能打开和下载?

    1. Rat's
      @az

      因为挂载了,等于使用VPS做了中转

      1. az
        @Rat's

        大佬,这个批量下载图片之后上传到GD后有重复文件啊,下载到VPS上是没有重复,但是上传之后就有重复的了,有重复3个,4个的

    2. az
      @az

      还有,貌似下载失败的文件也会存在VPS上,要自己手动删除么?

      1. Rat's
        @az

        这个还没注意,失败的文件在挂载目录之外?

        1. az
          @Rat's

          不是,好像是我手动删除的。DL文件夹内的,
          还有我想换个GD文件上传,改怎么修改参数啊?

  8. xiaow

    可以用宝塔部署环境嘛?

    1. Rat's
      @xiaow

      参考这个教程吧:https://www.moerats.com/archives/700/

  9. 晓风

    大佬这个就是爱云盘在哪删除呀。

    1. Rat's
      @晓风

      找到根目录/home/wwwroot/a.xx.com,修改某个源码文件

      1. 晓风
        @Rat's

        谢谢大佬呀,你真棒

        1. Rat's
          @晓风

          你更棒,加油

  10. 逸然

    这个,我生成ssl证书失败怎么办?

    1. Rat's
      @逸然

      有报错信息吗?