• 欢迎访问db1024网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏db1024吧

一个可以解决因api抽风出现空目录的OneDrive目录程序:OneList

主机教程 Liam 1年前 (2019-04-28) 7718次浏览 17个评论 扫描二维码
文章目录[隐藏]

说明:目前OneDrive目录程序已经很多了,比如:PyOneOneIndexOLAINDEX。这几个各有特色,都挺好用的,不过有时候api在高峰期抽风的时候,都很容易出现空目录的情况,导致下载会出现问题,这里萌咖sxyazi大佬就历时N天,写了个基于Python3的简约OneDrive目录列表,同时换了一种api来防止因使用人过多导致抽风等问题,稳定性大大的增加,而且使用Redis动态缓存策略,打开目录的速度是相当的快,不过该程序初衷只想安静的做个目录程序,所以是不会增加看视频的功能,如果你想看视频,那就选择开头的3个程序。

截图

一个可以解决因api抽风出现空目录的OneDrive目录程序:OneList

安装

Github地址:https://github.com/0oVicero0/OneList/

说明:该程序不适用OneDrive个人版,且建议使用Debian系统安装,会很快。

1、安装依赖
CenOS 6系统:

#安装EPEL rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm #安装Python3和Redis yum install python34 redis git -y #安装pip3 wget https://bootstrap.pypa.io/get-pip.py python3 get-pip.py #启动Redis service redis start #设置Redis开机自启 chkconfig redis on 

CenOS 7系统:

#安装EPEL rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm #安装Python3和Redis yum install python36 redis git -y #配置Python3软链接 ln -s /usr/bin/python3.6 /usr/bin/python3 #安装pip3 wget https://bootstrap.pypa.io/get-pip.py python3 get-pip.py #启动Redis systemctl start redis #设置Redis开机自启 systemctl enable redis 

Debian/Ubuntu系统:

#安装pip3和Redis apt update apt install python3-pip redis-server git -y 

2、安装OneList

#拉取源码 git clone https://github.com/0oVicero0/OneList.git #安装依赖 cd OneList && pip3 install -r requirements.txt 

获取auth_token
使用浏览器访问该地址→传送门,登录你的OneDrive账号,复制地址栏code=&session之间的参数。

获取refresh_token,在SSH客户端使用命令:

#将下面auth_token替换成你获取到的参数,再使用命令 code="auth_token" wget --no-check-certificate --post-data="client_id=ea2b36f6-b8ad-40be-bc0f-e5e4a4a7d4fa&client_secret=h27zG8pr8BNsLU0JbBh5AOznNS5Of5Y540l/koc7048=&grant_type=authorization_code&resource=https://api.office.com/discovery/&redirect_uri=http://localhost/onedrive-login&code=$code" 'https://login.microsoftonline.com/common/oauth2/token' -qO-

然后复制refresh_token参数后面的字段。

接下来在OneList目录新建config.json配置文件。

nano config.json

将以下内容复制进去:

#将下面refresh_token替换成你获取到的字段 {   "token": "<refresh_token>",   "location_path": "/",   "start_directory": "/",   "threads": 3,   "diff_seconds": 480,   "refresh_seconds": 720,   "metadata_cached_seconds": 768,   "structure_cached_seconds": 840 } 

再使用ctrl+xy保存退出。

开始运行:

gunicorn app:app -b 127.0.0.1:8888 -D

此时访问地址为127.0.0.1:8888,还需要使用域名反代才能访问,如果你要使用ip访问,将运行命令改成0.0.0.0:8888即可。

3、域名反代
安装Caddy

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

配置Caddy

#以下全部内容是一个整体,请修改域名后一起复制到SSH运行! echo "www.moerats.com {  gzip  tls [email protected]  proxy / 127.0.0.1:8888 }" > /usr/local/caddy/Caddyfile 

该配置会自动签发SSL,请提前解析域名到VPS服务器。

启动Caddy

/etc/init.d/caddy start 

就可以打开域名进行访问了。

最后如果你没有OneDrive大容量网盘可以申请1年开发者计划,申请地址→传送门;要是你觉得1年不够用,可以前往萌咖杂货店购买→传送门


db1024 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:一个可以解决因api抽风出现空目录的OneDrive目录程序:OneList
喜欢 (0)
关于作者:
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
(17)个小伙伴在吐槽
  1. This is my first time pay a quick visit at here and i am really happy to read everthing at one place.
    where can i buy viagra without a prescription2020-06-17 20:17 回复 未知操作系统 | Chrome 66.0.3359.181
  2. buy viagra without presc viagra without a doctor prescription buy viagra no prescription
    viagra without a doctor prescription2020-05-16 01:06 回复 Windows 8 | Firefox浏览器 60.0
  3. I do not even know how I ended up here, but I thought this post was great. I do not know who you are but certainly you are going to a famous blogger if you are not already ;) Cheers!
    Royal CBD2020-05-14 16:02 回复 Windows 8 | Chrome 64.0.3282.186
  4. order viagra online online pharmacy viagra viagra prescription online
    viagra prices2020-05-13 16:48 回复 Windows 8 | Chrome 65.0.3325.181
  5. Now let's learn about a number of things that you can do to help increase your power so that you can live a more satisfying life. Regardless of how it got there, you are stuck to deal with it and experience it. No doubt you are able to get these fatty acids from fish too, but doctors suggest that you lessen the quantity of fish consume when you're pregnant because of fears of mercury poisoning.
    toilet paper holder2020-05-13 04:23 回复 Windows 8.1 | Chrome 66.0.3359.139
  6. Very nice article. I certainly love this website. Thanks!
    natural viagra for men2020-05-12 06:57 回复 Windows 7 | Firefox浏览器 59.0
  7. viagra pills how much is viagra viagra coupons
    viagra cost per pill2020-04-23 18:55 回复 Windows 8 | Firefox浏览器 52.0
  8. viagra walmart online viagra prescription cost of viagra
    canadian viagra2020-04-23 18:54 回复 Windows 7 | Chrome 67.0.3393.4
  9. художественный фильм доктор лиза Фильм Доктор Лиза (2020) фильм доктор лиза смотреть онлайн
    Фильм Доктор Лиза (2020)2020-04-20 16:54 回复 Windows 7 | Chrome 63.0.3239.132
  10. Онлайн консультация психолога Коротков Сергей Онлайн консультация психолога Сергей Коротков
  11. zilis cbd oil hempoil hemp oil store hemp oil cbd
    hemp seed oil benefits2020-03-11 23:28 回复 Windows 7 | Chrome 53.0.2785.104
  12. canadian drugs online pharmacy canada canadian pharmacies generic drugs online
    canadian pharmaceuticals2020-03-10 20:57 回复 Windows 7 | Chrome 63.0.3239.26
  13. Hello men. And Bye.
    LavyMug2020-03-05 17:31 回复 Windows 10 | Chrome 61.0.3163.100
  14. otc cialis printable cialis coupon online cialis
    generic cialis online2020-02-24 21:56 回复 Windows 7 | Chrome 54.0.2840.59
  15. how much does viagra cost Скажене весілля. Скажене весілля 2 viagra prices
    Скажене весілля. Скажене весілля 22020-02-23 03:27 回复 Windows 7 | Chrome 61.0.3163.31
  16. how much does viagra cost viagra canada amazon viagra
    viagra for sale2020-02-19 21:22 回复 Windows 7 | Chrome 61.0.3163.69
  17. walmart viagra canadian online pharmacy viagra is viagra over the counter
    can you buy viagra over the counter2020-02-18 07:22 回复 Windows 7 | Chrome 54.0.2840.59