请注意,本文编写于 485 天前,最后修改于 476 天前,其中某些信息可能已经过时。
一开始折腾了半天,总是无法自动上传,最终参考 @ZYong 的文章成功实现~
1
安装Aria2
# Github
wget -N --no-check-certificate https://raw.githubusercontent.com/ToyoDAdoubiBackup/doubi/master/aria2.sh && chmod +x aria2.sh && bash aria2.sh
# Gitee
wget -N --no-check-certificate https://gitee.com/fengsec/Aria-OneDrive/raw/master/aria2.sh && chmod +x aria2.sh && bash aria2.sh
$ bash aria2.sh
10
自动更新BT-Tracker
服务器,然后输入y
$ bash aria2.sh
- [国际版、商业版、家庭版](https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=78d4dc35-7e46-42c6-9023-2d39314433a5&response_type=code&redirect_uri=http://localhost/onedrive-login&response_mode=query&scope=offline_access%20User.Read%20Files.ReadWrite.All)
- [中国版(世纪互联)](https://login.chinacloudapi.cn/common/oauth2/v2.0/authorize?client_id=dfe36e60-6133-48cf-869f-4d15b8354769&response_type=code&redirect_uri=http://localhost/onedrive-login&response_mode=query&scope=offline_access%20User.Read%20Files.ReadWrite.All)登录后会跳转到一个以
http://localhost/onedrive-login?code=OAQABAAIAAAAm-06blBE1TpVMil8KPQ41c8bkjrEMWeBECgahoaqGcj0fJocbWU4C7RNHI7D4yyQuFy1GSSPxtd7hXG-HmiJJ68KwgNoFmE6-5duZfnpT1L2Jge8NIu1Ul6dWP0TMcNQsC.......I89IlFR-hfQuYKjZIMxF5kpikIoeIAA&session_state=6dea7d52-c3a8-4add-a4a3-421254474f40
# 64位系统下载
$ wget https://gitee.com/fengsec/Aria-OneDrive/raw/master/OneDriveUploader/amd64/linux/OneDriveUploader -P /usr/local/bin/
# 32位系统下载
$ wget https://gitee.com/fengsec/Aria-OneDrive/raw/master/OneDriveUploader/i386/linux/OneDriveUploader -P /usr/local/bin/
# arm架构下载
$ wget https://gitee.com/fengsec/Aria-OneDrive/raw/master/OneDriveUploader/arm/linux/OneDriveUploader -P /usr/local/bin/
$ chmod +x /usr/local/bin/OneDriveUploader
url
换成上面复制的授权地址,包括http://loaclhost
# 国际版/教育版
OneDriveUploader -a "url"
# 个人版/家庭版
OneDriveUploader -ms -a "url"
# 中国版(世纪互联)
OneDriveUploader -cn -a "url"
Init config file: /path/to/file/auth.json
类似信息,则初始化成功$ touch 1.txt
$ /usr/local/bin/OneDriveUploader -s "1.txt"
rcloneupload.sh
, 填入以下代码- 如果使用`aria2.sh`脚本修改了下载目录,这里也需要修改
#!/bin/bash
GID="$1";
FileNum="$2";
File="$3";
MaxSize="15728640";
Thread="3"; # 默认3线程,自行修改,服务器配置不好的话,不建议太多
Block="20"; # 默认分块20m,自行修改
RemoteDIR=""; # 上传到Onedrive的路径,默认为根目录,如果要上传到File目录,""里面请填成File
LocalDIR="/usr/local/caddy/www/Download/"; # Aria2下载目录,记得最后面加上/
Uploader="/usr/local/bin/OneDriveUploader"; # 上传的程序完整路径,默认为本文安装的目录
Config="/root/auth.json"; # 初始化生成的配置auth.json绝对路径,参考第3步骤生成的路径
if [[ -z $(echo "$FileNum" |grep -o '[0-9]*' |head -n1) ]]; then FileNum='0'; fi
if [[ "$FileNum" -le '0' ]]; then exit 0; fi
if [[ "$#" != '3' ]]; then exit 0; fi
function LoadFile(){
if [[ ! -e "${Uploader}" ]]; then return; fi
IFS_BAK=$IFS
IFS=$'\n'
tmpFile="$(echo "${File/#$LocalDIR}" |cut -f1 -d'/')"
FileLoad="${LocalDIR}${tmpFile}"
if [[ ! -e "${FileLoad}" ]]; then return; fi
ItemSize=$(du -s "${FileLoad}" |cut -f1 |grep -o '[0-9]*' |head -n1)
if [[ -z "$ItemSize" ]]; then return; fi
if [[ "$ItemSize" -ge "$MaxSize" ]]; then
echo -ne "\033[33m${FileLoad} \033[0mtoo large to spik.\n";
return;
fi
${Uploader} -c "${Config}" -t "${Thread}" -b "${Block}" -s "${FileLoad}" -r "${RemoteDIR}" -skip
if [[ $? == '0' ]]; then
rm -rf "${FileLoad}";
fi
IFS=$IFS_BAK
}
LoadFile;
$ chmod +x rcloneupload.sh
$ vim /root/.aria2/aria2.conf
# 最后一行加入以下代码
on-download-complete=/root/rcloneupload.sh
# Centos
$ yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh
# Ubuntu/Deepin
$ wget -O install.sh http://download.bt.cn/install/install-ubuntu_6.0.sh && sudo bash install.sh
PHP7.2
、Nginx1.16
Aria
**端口,默认**6800
**,否则AriaNg无法连接- [Github](https://github.com/mayswind/AriaNg/releases)
- [Gitee](https://gitee.com/fengsec/OneList/blob/master/AriaNg-1.1.4.zip)下载AriaNg源码后,在BT面板创建一个站点, 将源码放在站点根目录上即可打开网页访问该站点,显示未连接。选择左侧
已弃坑,现转用OLAINDEX
前期准备一个OneDrive账号一台服务器,本文使用CentOS 7一个域名,先将域名解析到服务器宝塔部署 步骤较...
- [Github](https://github.com/donwa/oneindex)
- [Gitee](https://gitee.com/fengsec/OneList/blob/master/oneindex-master.zip)这个就不多说了,只需要添加一个站点然后放入OneIndex源码,然后访问站点安装即可,不懂的百度即可修改站点配置文件,把以下内容注释,避免出现404
# location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
# {
# expires 30d;
# error_log off;
# access_log /dev/null;
# }
#
# location ~ .*\.(js|css)?$
# {
# expires 12h;
# error_log off;
# access_log /dev/null;
# }
OneIndex后台-基本设置
中勾选去掉地址栏中的/?/ (需配合伪静态使用!!)
if (!-f $request_filename){
set $rule_0 1$rule_0;
}
if (!-d $request_filename){
set $rule_0 2$rule_0;
}
if ($rule_0 = "21"){
rewrite ^/(.*)$ /index.php?/$1 last;
}
$ crontab -e
# 添加以下一行
*/10 * * * * php /www/wwwroot/one/one.php cache:refresh
Permission denied
错误,直接给OneIndex
目录777
权限即可这里使用神器PanDownload
,具体操作方法请查看文档:PanDownload - 远程下载
- 上传时出现:`unexpected end of JSON input`
- 这是因为授权文件`auth.json`被误操作覆盖了,重新授权即可授权文件:
$ OneDriveUploader -s "文件" # 上传文件
$ OneDriveUploader -s "文件" & # 上传文件并后台运行
版权属于:Naraku
本文链接:https://cloud.tencent.com/developer/article/1853388
本站所有原创文章均采用 知识共享署名-非商业-禁止演绎4.0国际许可证 。如需转载请务必注明出处并保留原文链接,谢谢~