worker搭建onedrive索引网盘

github:https://github.com/heymind/OneDrive-Index-Cloudflare-Worker

搭建方法也比较简单。论坛之前也有人问,现在又有人问,就写一个简单的教程吧。demo:https://cloud.zsxwz.workers.dev/

1、新建一个 APP:https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade

名称可以随意,帐户类型选择任何组织目录,重定向url:https://heymind.github.io/tools/microsoft-graph-api-auth

2、创建证书和密码,记一下密码client_secret,和应用id,client_id。

3、在 API permissions 面板, 添加以下权限 offline_access, Files.Read, Files.Read.All。(此权限可以在Microsoft Graph中找到)

4、获取refresh_token,可以使用rclone获取,也可以使用在线工具获取https://heymind.github.io/tools/microsoft-graph-api-auth

输入client_id,AUTHORIZE登录验证一下,即可获取code,输入client_secret,即可get token获取refresh_token,返回一大串数据,找到refresh_token,其他的都不要。

5、在 Cloudflare Worker 管理页面创建一个新的 Worker ,粘贴 index.js 中的代码并替换相关参数。

https://raw.githubusercontent.com/heymind/OneDrive-Index-Cloudflare-Worker/master/index.js

注意一下根目录,可以是一个文件夹,也可以使用”/”作为根目录。

base: “/”,

留言

* - 必填