Rat's

利用Aria2+AriaNg+H5ai+Google Drive建立离线BT下载/在线播放/无限空间网盘
说明:现在很多人撸了无限空间的Google Drive后,都不知道咋玩,这里可以利用小硬盘VPS挂载Google ...
扫描右侧二维码阅读全文
10
2018/02

利用Aria2+AriaNg+H5ai+Google Drive建立离线BT下载/在线播放/无限空间网盘

说明:现在很多人撸了无限空间的Google Drive后,都不知道咋玩,这里可以利用小硬盘VPS挂载Google Drive后进行一系列老司机操作,这里说下方法,过程不需要使用面板、LNMP等一键包,博主认为有点花时间,所以这里都使用一键脚本来完成,基本10分钟就搭建好了,且自带免费的SSL证书,可长期使用。

截图

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

教程

由于本教程所使用的H5ai一键包只适用Debian 8+,且必须纯净的系统,不含有WEB环境。

1、安装H5ai
H5ai一键安装包自带SSL证书,需要提前解析域名到服务器。使用命令:

#下载脚本
apt-get install git -y
git clone https://github.com/wulabing/h5ai_onekey_install-lnp-.git h5ai
cd h5ai

#Debian 8运行命令
bash h5ai.sh

#Debian 9运行命令
sed -i '53,54d' h5ai.sh && bash h5ai.sh

#脚本备份
https://www.moerats.com/usr/shell/h5ai_ssl.sh

运行后,选择3即可。完成后进入https://domain.com就可以打开了H5ai界面了,且目录在/home/wwwroot/domain.com

2、安装Aria2
这里用的逗比的脚本,使用命令:

wget -N --no-check-certificate https://raw.githubusercontent.com/ToyoDAdoubiBackup/doubi/master/aria2.sh && chmod +x aria2.sh && bash aria2.sh
#备用地址
wget -N --no-check-certificate https://www.moerats.com/usr/shell/Aria2/aria2.sh && chmod +x aria2.sh && bash aria2.sh

默认密匙为doub.io,下载目录为/usr/local/caddy/www/aria2/Download

3、安装AriaNg
博主认为AriaNg 0.2版本好用些,所以默认用这个,使用命令:

apt-get install unzip -y
mkdir /home/wwwroot/domain.com/ariaNg  #将domain改成你的域名再运行
cd /home/wwwroot/domain.com/ariaNg
wget https://www.moerats.com/usr/down/aria-ng-0.2.0.zip && unzip aria-ng-0.2.0.zip

此时进入https://domain.com/ariaNg就可以打开ariaNg界面了,记住该文件夹不能删,误删的重新此操作。

4、挂载Google Drive
教程参考:在Debian/Ubuntu上使用rclone挂载Google Drive网盘,注意挂载为磁盘的目录需要在H5ai目录里,且为子目录,比如/home/wwwroot/domain.com/GoogleDrive

5、配置上传Google Drive
直接通过Aria2下载文件到Google Drive挂载盘可能会有问题,所以需要简单操作下。
使用命令:

wget https://www.moerats.com/usr/shell/GDupload.sh

再编辑GDupload.sh文件

nano GDupload.sh

修改以下参数:

downloadpath='/usr/local/caddy/www/aria2/Download' #Aria2下载目录,这里默认逗比脚本目录,不变即可。
rclone='/home/wwwroot/xx.com/GoogleDrive'   #rclone挂载的目录

再授权chmod +x GDupload.sh,然后再到Aria2配置文件中加上一行on-download-complete=/root/GDupload.sh即可,后面为脚本的路径。

最后就可以愉快的去下电影和音乐了。

如果想一次性完成的,参考:Aria2+Rclone+DirectoryLister+Aria2Ng一键安装脚本 for Debian

Vultr新用户注册送100美元/16个机房按小时计费,支持支付宝,【点击查看】。
最后修改:2018 年 06 月 11 日 10 : 52 AM

发表评论 取消回复

178 条评论

  1. picaku

    Rat大大,实测自动上传,如果下载是的单个文件似乎是没有问题的。但如果是下载的BT的一个文件夹,里面有很多文件,似乎无法自动转移到GD里。不知是我设置问题,还是脚本本身问题。anyway 圣诞快乐

    1. Rat's
      @picaku

      你试试这个上传脚本,https://www.moerats.com/archives/482/,属于加强版。

  2. Mika

    请教博主,一切按照您手动安装的基本都正常。但不知为何,把Google drive 添加为nextcloud里的本地 外部存储后。在Google drive 客户端里上传的文件,无法在nexrxloud里同步,但在Google drive客户端执行删除文件,nextcloud可以同步。Next cloud里上传和删除文件,google drive. 客户端也能同步。唯独Google drive里上传的不能同步到nextcloud里。不知为何

    1. Rat's
      @Mika

      这个不是很清楚,没试过Nextcloud挂载GD,感觉读取权限问题。

  3. 马化腾

    请问现在这么申请Google Drive无限了,网上搜的方法都很老了

    1. Rat's
      @马化腾

      去申请一些大学的edu邮箱。

  4. Enter a string value. Press Enter for the default ("").
    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
    ID of the root folder
    Leave blank normally.
    Fill in to access "Computers" folders. (see docs).
    Enter a string value. Press Enter for the default ("").
    root_folder_id>

    1. Rat's
      @凯

      权限选择1。

  5. 55555

    E: Unsupported file /home/wwwroot/pan.goflysr.xyz/ariaNg given on commandline
    E: Unsupported file /home/wwwroot/pan.goflysr.xyz/ariaNg given on commandline
    错误

    1. Rat's
      @55555

      错误说具体点。

  6. 谁知道呢

    博主我全都是按你的教程走的,也成功了,但是一开h5ai就疯狂跑inbound流量是为啥呢?最后inbound跑了100多个G,outbound才3G,是因为rclone的问题吗?我没有把文件直接下到google drive的挂在目录啊,

    1. Rat's
      @谁知道呢

      不排除是rclone的问题,毕竟rclone本身还是有点BUG的

  7. wang

    用博主的上传配置一直无法解自动转移到GoogleDrive的问题,网上查了一下,用这个配置完美解决。https://raw.githubusercontent.com/zhouxiangbin/Code/master/autoupload.sh

    1. Rat's
      @wang

      能用就行,等有不能用的人看到你这个就可以试试了。

      1. Wang
        @Rat's

        好的,感谢楼主的教程

  8. 摸摸唧唧

    ariaNG最下面的aria2状态未连接,怎么回事呢

    1. Rat's
      @摸摸唧唧

      不知道你浏览器地址栏最右边有没有加载模块这个东西,有的话点击加载就连上了。

  9. harry

    然后再到Aria2配置文件中加上一行on-download-complete=/root/GDupload.sh即可,后面为脚本的路径。
    这个怎么做?

    1. harry
      @harry

      我知道了

  10. harry

    为什么我下载文件,页面GoogleDrive页面里面什么也没有,也同步不到Google里面?