添加 Google Drive 存储
不知道怎么获取 OAuth 凭证?点开看指引
第 1 步:启用 Google Drive API
访问 Google Cloud Console → APIs & Services → Library → 搜索 "Google Drive API" → 启用。
第 2 步:配置 OAuth 同意屏幕
APIs & Services → OAuth consent screen → User Type 选 External → Scopes 添加 ../auth/drive → Test users 加上自己的 Google 邮箱。
第 3 步:创建 OAuth 客户端
APIs & Services → Credentials → Create Credentials → OAuth client ID → Application type: Web application → Authorized redirect URIs 添加 https://api.oplist.org/google/callback → 创建后记下 client_idclient_secret
第 4 步:获取 refresh_token(推荐用 rclone)
在有浏览器的电脑上执行:rclone authorize "drive"
浏览器登录 Google 并授权后,终端会输出 JSON,复制其中 refresh_token 字段值(形如 1//xxxx)。
第 5 步(可选):获取 root_folder_id
打开 Google Drive 网页 → 进入目标文件夹 → 地址栏 https://drive.google.com/drive/folders/<这一段就是ID>
提示:refresh_token 长期有效;改 Google 账号密码或撤销授权后失效,届时在此面板"更新凭证"即可。
更新 OAuth 凭证
目标存储: (id=)
提示:refresh_token 失效通常表现为列表返回 401/认证失败;改 Google 账号密码或撤销授权后需重新获取。任一字段留空即保留原值。