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. 李佳玉

    我安装成功了,但是页面上cloud目录不显示我设置的“my-drive”目录;df -h命令确实显示了我的文件夹及当前全部已用空间啊

  2. 李佳玉

    烦哎,教程是有时效性的吗。。做着做着就和教程一点都不一样了,懵逼。就是从选择Google Drive的时候教程是10,实际显示的是13,然后下面就全部不一样了。。

    1. Rat's
      @李佳玉

      是的,选项会有变化的,不过大致上步骤差不多

  3. gqd000

    大佬,我想问一下,我vps磁盘空间不够,可不可以以挂载gd,更改下载位置到挂载的gd盘,直接就下的gd盘 了,这样可以吗?

    1. Rat's
      @gqd000

      直接下载好像可以,要改参数,不过不建议直接,你可以看下rclone文档

      1. gqd000
        @Rat's

        这脚本默认nginx1.10.3...

  4. siasong

    搭建完成,每次使用一段时间后,面板连接上后总是会出现正在加载的字样,看不到正在下载的任务,也看不到已完成的任务,但是能看到正在下载(面板上流量在跑)

    1. Rat's
      @siasong

      这个总是出现加载的话,好像我挂梯子访问面板的时候会出现

  5. 沉默的鱼

    麻烦更新下Debian10和centos8下的安装方法

    1. Rat's
      @沉默的鱼

      C8都还么用上

  6. CM

    大佬能出一个ubuntu版本的吗,谢谢!

  7. ikan

    谢谢大佬, 安装成功并且自动上传到网盘了。 请问为什么 /root/Download里面的文件上传后没能自动删除呢

    1. Rat's
      @ikan

      看下aria2日志

  8. xx

    请问,在vps上使用这个命令: rclone copy 谷歌团队盘 谷歌云盘(自己)

    会占用vps的带宽流量么?我从团队盘搬运了一个超大文件夹,结果vps提示流量已到上限~使用了1.5T流量~汗

    1. Rat's
      @xx

      肯定需要带宽的额,主要是上传带宽,你需要把文件上传到谷歌网盘

      1. xx
        @Rat's

        我是从谷歌的团队盘 转存到 谷歌的云盘,也占用带宽么?我没有下载下来,也没有上传呀~

        1. Rat's
          @xx

          你经过vps中转了的,肯定要带宽,而且你这种还需要上传+下载双倍

  9. keke

    已经安装成功,顺利下载自动上传到gd了,非常感谢,给我们节省了大量时间。另外请问怎么给DirectoryLister加密码呀,比如b.xx.com,好像谁都可以打开。

    1. Rat's
      @keke

      试试这个https://www.moerats.com/archives/171/

      1. keke
        @Rat's

        在第二步的时候vim /etc/nginx/conf.d/DirectoryLister.conf

        server{ listen 80; server_name b.xxx.xyz; index index.html index.php; root /home/wwwroot/b.xxx.xyz  ; location /CLoud/ { auth_basic "Please enter your username and password"; auth_basic_user_file /home/htpasswd; autoindex on; }}  

        没有任何效果哦

        1. Rat's
          @keke

          重启了没

          1. keke
            @Rat's

            重启了nginx,vps重启了也不行。后来尝试在/etc/nginx/conf.d/下新建了个b.xxx.xyz.conf,复制粘贴过去,重启nginx出错。

  10. 博主,請問檔案有失效嗎?安裝的時候出了問題..
    反饋如下,謝謝
    Package php7.0-curl is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    E: Unable to locate package php7.0-cgi
    E: Couldn't find any package by glob 'php7.0-cgi'
    E: Couldn't find any package by regex 'php7.0-cgi'
    E: Unable to locate package php7.0-fpm
    E: Couldn't find any package by glob 'php7.0-fpm'
    E: Couldn't find any package by regex 'php7.0-fpm'
    E: Package 'php7.0-curl' has no installation candidate
    E: Unable to locate package php7.0-gd
    E: Couldn't find any package by glob 'php7.0-gd'
    E: Couldn't find any package by regex 'php7.0-gd'
    [Error] php7 安装失败

    1. @天

      抱歉,是我自己的問題,我系統安裝錯Debian的版本了,呵呵