Rclone - 设置谷歌网盘
设置 Google Drive 之前大多数情况需要先设置代理,参考:Rclone 代理设置
# 设置谷歌网盘
- 执行
rclone config
开始配置,选择n
新建
$ ~ rclone config
No remotes found - make a new one
n) New remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
n/r/c/s/q> n
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
- 起一个名字。可以随便起,建议简短一点,后面使用经常需要输入
name> gdrive-geek
1
- 选择配置类型,每个配置对应一个编号,例如
Google Drive
是 13,不同版本可能不一样,这里我们输入 13
Choose a number from below, or type in your own value
...
\ "ftp"
12 / Google Cloud Storage (this is not Google Drive)
\ "google cloud storage"
13 / Google Drive
\ "drive"
14 / Google Photos
\ "google photos"
...
Storage> 13
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
- 输入一个 Client ID。可以直接回车跳过(后面说明他的作用)
Google Application Client Id - leave blank normally.
client_id>
1
2
2
- 输入 Client Secret。可以直接回车跳过(后面说明他的作用)
Google Application Client Secret - leave blank normally.
client_secret>
1
2
2
- 设置访问权限(读取、上传等),这里我们选择 1,最大的访问权限
Choose a number from below, or type in your own value
1 / Full access all files, excluding Application Data Folder.
\ "drive"
2 / Read-only access to file metadata and file contents.
\ "drive.readonly"
/ Access to files created by rclone only.
3 | These are visible in the drive website.
| File authorization is revoked when the user deauthorizes the app.
\ "drive.file"
/ Allows read and write access to the Application Data folder.
4 | This is not visible in the drive website.
\ "drive.appfolder"
/ Allows read-only access to file metadata but
5 | does not allow any access to read or download file content.
\ "drive.metadata.readonly"
scope> 1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
- root_folder_id 回车跳过
Enter a string value. Press Enter for the default ("").
root_folder_id>
1
2
2
- service_account_file 回车跳过
Enter a string value. Press Enter for the default ("").
service_account_file>
1
2
2
- 高级设置,回车跳过(等以后熟悉了再研究)
Edit advanced config? (y/n)
y) Yes
n) No (default)
y/n> n
1
2
3
4
2
3
4
- 自动设置,输入
n
否
Use auto config?
* Say Y if not sure
* Say N if you are working on a remote or headless machine
y) Yes (default)
n) No
y/n> n
1
2
3
4
5
6
2
3
4
5
6
- 授权访问 Google Drive
Please go to the following link: https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=633673828465-jc6js9nrjhdjdpb62ikk570tm8gi29c2.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&state=3rK7aTj8sbK3dV25z_TkvA
Log in and authorize rclone for access
Enter verification code> 4/1AY0e-g7ZNHrIb--2LD6CNwa2hXNurJ49IPiUTW_zvPyXaw9
1
2
3
2
3
将连接(following link)复制到浏览器打开
在授权弹窗中选择“允许”
复制授权码到终端,回车确认
- 是否是团队网盘,选择
n
否(看自己情况而定)
Configure this as a team drive?
y) Yes
n) No (default)
y/n> n
1
2
3
4
2
3
4
- 确认配置完成,选择
y
或者留空,回车确认
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d> y
1
2
3
4
2
3
4
- 完成配置,选择
q
退出,如果要继续配置,可以选择n
Current remotes:
Name Type
==== ====
gdrive-geek drive
e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> q
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
可以执行rclone lsd gdrive-geek:
测试一下配置有没有问题(根据自己情况,把 gdrive-geek 改成自己配置的名称)
# 常见问题
# googleapi Error 403 Rate Limit Exceeded,
这个问题是是我们访问 Google Drive 的 api 超过了次数限制。
我们访问 Google Drive 的时候需要通过一个 Client Id 提供 api 支持,如果没有配置的话,则使用 Rclone 提供的默认配置,所有可能会有很多人在使用,超过了限制。解决办法是我们可以申请自己的 Client Id,如何申请可以看 Rclone 的官方文档:https://rclone.org/drive/#making-your-own-client-id (opens new window)
创建项目(如果已经有创建过可以跳过)
开启 API 权限
如果需要设置 Google Photos 可以一起把权限开启了
设置 Oauth 授权认证
创建 Oauth 客户端凭据
这里就是设置 Google Drive 时候的 Client Id 和 Client Secret 了
后面忘记了可以从这里查看
ps: 我们自己创建的 Client Id,在认证的时候会提示不安全,直接忽略掉就可以了

# 完整配置过程
点击展开完整内容
$ ~ rclone config
No remotes found - make a new one
n) New remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
n/r/c/s/q> n
name> gdrive-geek
Type of storage to configure.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
1 / 1Fichier
\ "fichier"
2 / Alias for an existing remote
\ "alias"
3 / Amazon Drive
\ "amazon cloud drive"
4 / Amazon S3 Compliant Storage Provider (AWS, Alibaba, Ceph, Digital Ocean, Dreamhost, IBM COS, Minio, Tencent COS, etc)
\ "s3"
5 / Backblaze B2
\ "b2"
6 / Box
\ "box"
7 / Cache a remote
\ "cache"
8 / Citrix Sharefile
\ "sharefile"
9 / Dropbox
\ "dropbox"
10 / Encrypt/Decrypt a remote
\ "crypt"
11 / FTP Connection
\ "ftp"
12 / Google Cloud Storage (this is not Google Drive)
\ "google cloud storage"
13 / Google Drive
\ "drive"
14 / Google Photos
\ "google photos"
15 / Hubic
\ "hubic"
16 / In memory object storage system.
\ "memory"
17 / Jottacloud
\ "jottacloud"
18 / Koofr
\ "koofr"
19 / Local Disk
\ "local"
20 / Mail.ru Cloud
\ "mailru"
21 / Mega
\ "mega"
22 / Microsoft Azure Blob Storage
\ "azureblob"
23 / Microsoft OneDrive
\ "onedrive"
24 / OpenDrive
\ "opendrive"
25 / OpenStack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
\ "swift"
26 / Pcloud
\ "pcloud"
27 / Put.io
\ "putio"
28 / QingCloud Object Storage
\ "qingstor"
29 / SSH/SFTP Connection
\ "sftp"
30 / Sugarsync
\ "sugarsync"
31 / Tardigrade Decentralized Cloud Storage
\ "tardigrade"
32 / Transparently chunk/split large files
\ "chunker"
33 / Union merges the contents of several upstream fs
\ "union"
34 / Webdav
\ "webdav"
35 / Yandex Disk
\ "yandex"
36 / http Connection
\ "http"
37 / premiumize.me
\ "premiumizeme"
38 / seafile
\ "seafile"
Storage> 13
** See help for drive backend at: https://rclone.org/drive/ **
Google Application Client Id
Setting your own is recommended.
See https://rclone.org/drive/#making-your-own-client-id for how to create your own.
If you leave this blank, it will use an internal key which is low performance.
Enter a string value. Press Enter for the default ("").
client_id> 633673828465-jc6js9nrjhdjdpb62ikk570tm8gi29c2.apps.googleusercontent.com
OAuth Client Secret
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_secret> zuCltfGFXauecoLmqhtONzqp
Scope that rclone should use when requesting access from drive.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
1 / Full access all files, excluding Application Data Folder.
\ "drive"
2 / Read-only access to file metadata and file contents.
\ "drive.readonly"
/ Access to files created by rclone only.
3 | These are visible in the drive website.
| File authorization is revoked when the user deauthorizes the app.
\ "drive.file"
/ Allows read and write access to the Application Data folder.
4 | This is not visible in the drive website.
\ "drive.appfolder"
/ Allows read-only access to file metadata but
5 | does not allow any access to read or download file content.
\ "drive.metadata.readonly"
scope> 1
ID of the root folder
Leave blank normally.
Fill in to access "Computers" folders (see docs), or for rclone to use
a non root folder as its starting point.
Enter a string value. Press Enter for the default ("").
root_folder_id>
Service Account Credentials JSON file path
Leave blank normally.
Needed only if you want use SA instead of interactive login.
Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`.
Enter a string value. Press Enter for the default ("").
service_account_file>
Edit advanced config? (y/n)
y) Yes
n) No (default)
y/n> n
Remote config
Use auto config?
* Say Y if not sure
* Say N if you are working on a remote or headless machine
y) Yes (default)
n) No
y/n> n
Please go to the following link: https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=633673828465-jc6js9nrjhdjdpb62ikk570tm8gi29c2.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&state=3rK7aTj8sbK3dV25z_TkvA
Log in and authorize rclone for access
Enter verification code> 4/1AY0e-g7O8Q7dU7--4pXsbqHqBioeXh_jM8zizp_3Lqb6hp1tAM0VR1cJJgQ
Configure this as a team drive?
y) Yes
n) No (default)
y/n> n
--------------------
[gdrive-geek]
type = drive
client_id = 633673828465-jc6js9nrjhdjdpb62ikk570tm8gi29c2.apps.googleusercontent.com
client_secret = zuCltfGFXauecoLmqhtONzqp
scope = drive
token = {"access_token":"ya29.a0AfH6SMBXZt5tB-PrRJcYsSg0mR2-ypBhgbc0KnwiYzZhzzZWCn8r2nXlqIA-TcgNCs52rKO8cchnBfgxeljprhUoXwjEyNCv3WdmXaR_QXMzb-wd2XPZ8ykj9xFcJa7_cvwCCxmxzBbFBskRQglQ82eI7g0tfq5dbaarpftRW78","token_type":"Bearer","refresh_token":"1//0ekCNnSnJBvc5CgYIARAAGA4SNwF-L9Ir9aevc_GQ40JS3D9ln5-LTlumB02onsxs9FSUDl_6Za3TplAJTQIdztMQu1gRnPc-O_g","expiry":"2020-11-26T11:24:40.010066+08:00"}
--------------------
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d> y
Current remotes:
Name Type
==== ====
gdrive-geek drive
e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> q
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
- 01
- 旧电脑安装windows11最简单的方法-绿色又健康,附激活脚本11-08
- 02
- 小白入门级NAS首选,开箱即用,不折腾,打造你的家庭影院09-29
- 03
- 工信部出手,查一下你的手机号都注册了哪些网络账号09-26