使用你自己的 Google Drive 客户端 ID
当 Google Drive 远程没有 client_id 时,rclone 会使用 rclone 的共享客户端 ID 登录。这个客户端 ID 的请求配额由众多 rclone 用户共同使用,因此使用它的远程可能会变慢,或因 403 错误而失败。rclone 文档还指出,共享客户端 ID 正在停用,将在 2026 年内停止工作。
当 client_id 为空时,RcloneView 会在 Add Google Drive 和 Edit Remote 对话框中显示以下提示:
本指南介绍如何在 Google Cloud 控制台中创建你自己的客户端 ID 和客户端密钥,将其填 入 RcloneView,然后重新登录。第 1~5 步在 Google Cloud 控制台中完成,第 6~7 步在 RcloneView 中完成。
更喜欢看视频?这段 3 分钟的视频(英文字幕)演示了下面的每一个步骤。
以下步骤依据 rclone 的指南 Making your own client_id(即 How to create your own client ID 链接打开的页面),并与 2026 年 12 月的 Google Cloud 控制台界面一致。Google 会不时调整控制台界面;如果下面的名称与你看到的不一致,请查看 rclone 的指南。
第 1 步:创建项目并启用 Google Drive API
-
登录 Google Cloud 控制台。任何 Google 账号都可以,不必与要连接的 Google Drive 账号相同。
-
打开页面顶部的项目选择器,新建一个项目(也可以选择现有项目)。输入 Project name(例如
rcloneview-client-id),然后点击 Create。如果你使用 Google Workspace 账号登录,还会显示填有你所在组织域名的 Organization 字段(下方截图使用的是 Workspace 账号),保持原样即可。使用个人 Google 账号(Gmail)时没有 Organization 字段,Location 显示为 No organization,同样保持原样即可。
-
确认页面顶部已选中新项目。在搜索栏中搜索 Google Drive API,打开它并点击 Enable。
第 2 步:配置 OAuth 同意屏幕
-
进入 APIs & Services › Credentials(点击左侧面板中的 Credentials,不要点 Create credentials,那会打开向导)。页面上会显示 "Remember to configure the OAuth consent screen" 横幅。点击 Configure consent screen,然后点击 Get started。
-
Project configuration 向导随即打开。在 1 App Information 中输入 App name(例如
rclone),选择 User support email(填你自己的邮箱即可),然后点击 Next。
-
在 2 Audience 中选择 External,然后点击 Next。如果你使用 Google Workspace 账号,且只有组织内的用户会使用此客户端 ID,也可以选择 Internal;这样就不需要添加测试用户或发布应用(第 4 步)。
-
在 3 Contact Information 中输入 Google 用于发送项目相关通知的邮箱地址,然后点击 Next。
-
在 4 Finish 中勾选 I agree to the Google API Services User Data Policy,点击 Continue,再点击 Create。
第 3 步:添加 Google Drive 范围(scope)
-
点击左侧面板中的 Data Access,然后点击 Add or remove scopes。Update selected scopes 面板随即打开。
-
向下滚动到 Manually add scopes,粘贴以下三个范围(每行一个,或用逗号分隔),然后点击 Add to table:
https://www.googleapis.com/auth/docshttps://www.googleapis.com/auth/drivehttps://www.googleapis.com/auth/drive.metadata.readonly
-
这三个范围会出现在表格顶部,并已勾选。点击面板底部的 Update。
-
回到 Data Access 页面后,这些范围会列在 Your sensitive scopes 和 Your restricted scopes 下。点击页面底部的 Save。只有点击 Save 后,范围才会被保存。