前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >在Windows下使用rclone挂载GoogleDrive团队盘

在Windows下使用rclone挂载GoogleDrive团队盘

原创
作者头像
ldeus
修改2020-06-15 10:33:58
15.2K1
修改2020-06-15 10:33:58
举报
文章被收录于专栏:ldeusldeus

前几天edu教育网账号翻车了,登录时发现账号被删了,里面存了9T的资源也灰飞烟灭了。不过使用这个edu给我自己Gmail开的团队盘居然还在,稍加思索一番,好像还能接着用。之前一直用的RaiDrive在Windows上面挂载的GoogleDrive,不过RaiDrive似乎不能挂载团队盘 (2020.6.12现在支持了,建议直接RaiDrive一步到位,可以不用折腾这些花里胡哨的东西来浪费时间了。以及,我的团队盘依旧还活着。该edu账号是在18年10月份在Ebay上0.99$收的)。就这样,又用上了rclone。

安装

这个没啥好说的,装就完事,这是一些实现该方法所必须的软件。

Rclone是一个命令行程序,用于管理云存储上的文件。它是云供应商Web存储界面的功能丰富的替代方案。

WinFsp是一种系统软件,它为Windows计算机上的自定义文件系统提供运行时和开发支持。

rclone的Windows版为压缩包文件,解压出来就能直接使用;winfsp直接全选下一步就可以了。

网络环境配置

使用GoogleDrive的前提当然需要你能访问Google Drive及其相关服务。请确保你的网络能访问如下链接:

www.googleapis.com

如果能正常访问,请跳过这些直接看下一小节,以及删掉所有http代理步骤。

配置环境变量确保可用访问Google Drive

http_proxy=ip:port

https_proxy=ip:port

当然如果有使用Proxifier这种工具似乎也可以的(2020.6.12该方法不太行,必须使用下面的方法,如果有成功使用该软件实现该方法的请留言)。

博主并没有采用该方法,而是采用的vbs设置,下面会有写。

因为有时候会用到rclone命令,就顺道给rclone也加入了环境变量方便操作。

在rclone配置中添加网盘

输入rclone config进入rclone的配置

代码语言:txt
复制
C:\Users\admin>rclone config
Current remotes:

Name                 Type
====                 ====
ldeus                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> n                        #这里输入n,新建
name> ldeusyn1                          #这里输入要新建的名字,后面挂载要用到
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, 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 / JottaCloud
   \ "jottacloud"
17 / Koofr
   \ "koofr"
18 / Local Disk
   \ "local"
19 / Mail.ru Cloud
   \ "mailru"
20 / Mega
   \ "mega"
21 / Microsoft Azure Blob Storage
   \ "azureblob"
22 / Microsoft OneDrive
   \ "onedrive"
23 / OpenDrive
   \ "opendrive"
24 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
   \ "swift"
25 / Pcloud
   \ "pcloud"
26 / Put.io
   \ "putio"
27 / QingCloud Object Storage
   \ "qingstor"
28 / SSH/SFTP Connection
   \ "sftp"
29 / Transparently chunk/split large files
   \ "chunker"
30 / Union merges the contents of several remotes
   \ "union"
31 / Webdav
   \ "webdav"
32 / Yandex Disk
   \ "yandex"
33 / http Connection
   \ "http"
34 / premiumize.me
   \ "premiumizeme"
Storage> 13                             #这里选择GoogleDrive对应的数字为: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>                              #留空,回车
Google Application Client Secret
Setting your own is recommended.
Enter a string value. Press Enter for the default ("").
client_secret>                          #留空,回车
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            #选择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.

Note that if this is blank, the first time rclone runs it will fill it
in with the ID of the root folder.

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.
Enter a string value. Press Enter for the default ("").
service_account_file>
Edit advanced config? (y/n)
y) Yes
n) No
y/n> 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
n) No
y/n> n                                  #选择n
If your browser doesn't open automatically go to the following link: https://accounts.google.com/o/oauth2/auth?access_type=
Log in and authorize rclone for access  #此处有个url,打开登录google账号获取key
Enter verification code>                #复制粘贴填在此处
Configure this as a team drive?         #这里询问是否为团队盘
y) Yes                                  #我这里使用的团队盘
n) No                                   #如果想使用自己的个人盘请选n
y/n> y
                
                
Fetching team drive list...
Choose a number from below, or type in your own value
 1 / ldeus
   \ "0APAV3AfAUB1AVA9PVA"
 2 / ldeussyn1
   \ "0AV1_AA2UVABKUk9PVA"
Enter a Team Drive ID> 2                #这里选择你要使用的团队盘
2020/01/09 13:28:06 ERROR : Failed saving config "team_drive" = "0AV1_AA2UVABKUk9PVA" in section "ldeusyn1" of the config file: section 'ldeusyn1' not found
--------------------
[ldeusyn1]
type = drive
scope = drive
token = {"access_token":""}
team_drive = 0AV1_AA2UVABKUk9PVA
--------------------
y) Yes this is OK
e) Edit this remote
d) Delete this remote
y/e/d> y
Current remotes:

Name                 Type
====                 ====
ldeus                drive
ldeusyn1             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                        #输入q

挂载

Or on Windows like this where X: is an unused drive letter

rclone mount remote:path/to/files X:

在上一步中我所使用的名字为ldeusyn1,那么挂载时使用的命令为

rclone mount ldeusyn1:/ g: --copy-links --no-gzip-encoding --no-check-certificate --allow-other --allow-non-empty

具体参数请参考https://rclone.org/commands/

这里解释一下以上需要修改的参数:

ldeusyn1 为new remote时创建的名字,自行修改。

g: 挂载在Windows上使用的盘符。

开机自动挂载

使用上面的命令进行挂载会一直使终端一直保持在前台运行,不是很友好,而且关机后挂载会消失。

因此创建rclone.vbs文件粘贴以下内容其中,并移动到C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp目录下,这样开机就会自动执行该vbs程序。

代码语言:txt
复制
Option Explicit
Dim WMIService, Process, Processes, Flag, WS ,ProcessEnv
Set WMIService = GetObject("winmgmts:{impersonationlevel=impersonate}!\\.\root\cimv2")
Set Processes = WMIService.ExecQuery("select * from win32_process")
Flag = true
for each Process in Processes
    if strcomp(Process.name, "rclone.exe") = 0 then
        Flag = false
        exit for
    end if
next
Set WMIService = nothing
if Flag then
    Set WS = Wscript.CreateObject("Wscript.Shell")
	Set ProcessEnv = WS.Environment("PROCESS")
	ProcessEnv("https_proxy") = "127.0.0.1:12333"
	ProcessEnv("http_proxy") = "127.0.0.1:12333"
	'此处自行修改设置http代理
	WS.Run "taskkill /f /im rclone.exe"
	WS.Run "rclone mount ldeus:/ f: --copy-links --no-gzip-encoding --no-check-certificate --allow-other --allow-non-empty", 0
	WS.Run "rclone mount ldeusyn1:/ g: --copy-links --no-gzip-encoding --no-check-certificate --allow-other --allow-non-empty", 0
	'修改上面的挂载命令进行挂载
end if

双击运行,电脑已经挂上了这块硬盘。并且在每次系统启动的时候会执行该vbs程序自动挂载Google Drive。

任务管理器
任务管理器

为什么我使用GoogleDeive团队盘:

  1. 便宜(价格低至0?相对于其他网盘来说,不限量不限速);
  2. 稳定(相对 事实上,我使用的Google Drive团队盘比直接拿edu开的Google Drive时间还要长一年左右,我的edu邮箱挂了很久,但其所开的团队盘依旧没挂。但也有挂掉的团队盘,请不要保有侥幸心理。作为稳定使用的网盘,建议直接充值12$);
  3. 方便同步。(因为可以开多个团队盘,使用Rclone在其之间做数据同步,保证数据的可靠性。但不建议仅仅使用其保存数据。在最低价格情况下,可以考虑增加使用OneDrive的25T空间同步数据);
  4. 限制少(首先是每日750G上传限制,这个有方法破,使用多账户;然后是相对与OneDrive来说,对文件大小、文件名、文件格式没有那么多限制,批量上传相对友好;就容量来说也是比OneDrive的25T足够多的多)。

写在最后

如果有遇到什么问题可以到我的博客下留言:https://ldeus.com/ (已关闭留言功能)

该文章于2020.6.12重新编辑,发现RaiDrive已经可以挂载Google Drive的团队盘。在 新虚拟驱动器->服务类型:Business->Google Shared drives 中可以直接挂载Google团队盘。

请注意:
  1. 在挂载之前,请确保你的浏览器和RaiDrive能够正常的访问Google。
  2. 可以在RaiDrive的设置中设置代理选项为HTTP代理,并在添加新虚拟驱动器时勾选代理选项。- √ 代理
  3. 在使用前,请确保你有团队盘。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 安装
  • 网络环境配置
  • 在rclone配置中添加网盘
  • 挂载
  • 开机自动挂载
  • 为什么我使用GoogleDeive团队盘:
  • 写在最后
    • 请注意:
    相关产品与服务
    访问管理
    访问管理(Cloud Access Management,CAM)可以帮助您安全、便捷地管理对腾讯云服务和资源的访问。您可以使用CAM创建子用户、用户组和角色,并通过策略控制其访问范围。CAM支持用户和角色SSO能力,您可以根据具体管理场景针对性设置企业内用户和腾讯云的互通能力。
    领券
    问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档