嗷嗷牛人大佬:

安装Aria2需要的软件

  1. yum install -y wget curl ca-certificates

安装Aria2

  1. wget -N git.io/aria2.sh && chmod +x aria2.sh
  2. ./aria2.sh

安装Python3.8

  1. yum -y groupinstall "Development Tools"
  2. yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libffi-devel
  3. cd /tmp
  4. wget https://www.python.org/ftp/python/3.8.7/Python-3.8.7.tgz
  5. tar -zxf Python-3.8.7.tgz
  6. cd Python-3.8.7
  7. ./configure –prefix=/usr/local/python3
  8. make && make install
  9. ln -s /usr/local/python3/bin/python3.8 /usr/bin/python3
  10. ln -s /usr/local/python3/bin/pip3.8 /usr/bin/pip3

安装天翼网盘CLI工具

  1. yum -y install git
  2. cd ~
  3. git clone https://github.com/Aruelius/cloud189.git
  4. cd cloud189
  5. pip3 install -r requirements.txt

天翼网盘CLI配置账号、文件夹

  1. python3 main.py
  2. mkdir aria2
  3. cd aria2

配置Aria2的下载完成事件脚本
改/root/.aria2c/aria2.conf,找到“下载完成后执行的命令”,把clean.sh替换为upload-189.sh。
如果你不是用这个脚本安装的,没有这一行,就新增一行,写下面的内容

  1. # 下载完成后执行的命令
  2. on-download-complete=/root/.aria2c/upload-189.sh

把下面的内容写到/root/.aria2c/upload-189.sh,保存完记得授予执行权限chmod +x /root/.aria2c/upload-189.sh

  1. #!/bin/bash
  2. GID="$1";
  3. FileNum="$2";
  4. File="$3";
  5. MinSize="5"  #限制最低上传大小,默认5k
  6. MaxSize="157286400"  #限制最高文件大小(单位k),默认15G
  7. #RemoteDIR="/RATS/";  #rclone挂载的本地文件夹,最后面保留/
  8. LocalDIR="/root/downloads/";  #Aria2下载目录,最后面保留/
  9. if *’ |head -n1) ]]; then FileNum=’0′; fi
  10. if ]; then exit 0; fi
  11. if ]; then exit 0; fi
  12. function LoadFile(){
  13.   IFS_BAK=$IFS
  14.   IFS=
  15. 改完配置必须重启aria2,使用命令bash ~/aria2.sh执行脚本,然后按照提示重启。
  16. 感谢:
  17. https://github.com/P3TERX/aria2.sh
  18. https://github.com/Aruelius/cloud189
  19. https://www.moerats.com/archives/482/
  20. 觉得有用的话不妨帮我IP+1,谢谢
  21. https://haoduck.com/698.html
  22. \n’
  23.   if ]; then return; fi
  24.   if ]; then
  25.     FileLoad="${File/#$LocalDIR}"
  26.     while true
  27.       do
  28.         if ]; then return; fi
  29.         echo "$FileLoad" |grep -q ‘/’;
  30.         if ]; then
  31.           FileLoad=$(dirname "$FileLoad");
  32.         else
  33.           break;
  34.         fi;
  35.       done;
  36.     if ]; then return; fi
  37.     EXEC="$(command -v python3)"
  38.     if ]; then return; fi
  39.     Option=" ~/cloud189/main.py upload";
  40.     cd "$LocalDIR";
  41.     if ]; then
  42.       ItemSize=$(du -s "$FileLoad" |cut -f1 |grep -o ‘*’ |head -n1)
  43.       if ]; then return; fi
  44.       if ]; then
  45.         echo -ne "\033]; then
  46.         echo -ne "\033[33m$FileLoad \033[0mtoo large to spik.\n";
  47.         return;
  48.       fi
  49.       #eval "${EXEC}${Option}" \’"${FileLoad}"\’ "${RemoteDIR}";
  50.       eval "${EXEC}${Option}" \’"${FileLoad}"\’;
  51.       rm -rf "${FileLoad}"
  52.     fi
  53.   fi
  54.   IFS=$IFS_BAK
  55. }
  56. LoadFile;

改完配置必须重启aria2,使用命令bash ~/aria2.sh执行脚本,然后按照提示重启。

感谢:
https://github.com/P3TERX/aria2.sh
https://github.com/Aruelius/cloud189
https://www.moerats.com/archives/482/

觉得有用的话不妨帮我IP+1,谢谢

https://haoduck.com/698.html

嗷嗷牛人大佬:
测试图片(从博客上复制的,因为有人偷盗文章,连图片一起偷那种,所以加了水印,见谅)

Aria2+天翼网盘的教程-图1
Aria2+天翼网盘的教程-图2

sosodm牛人大佬:
感谢楼主分享 学习了