大家都知道Google向来对学生都是比较良心的,国外大学的学生邮箱申请到的Googledrive都是无限容量的,而且下载速度不限制(这里要注意你的网络环境必须是在挂代理的情况下),但是很多人都没有可用的代理,中国GFW已经封锁互联网环境已经快20年了,大部分人是访问不了谷歌的,因为一些政策原因,在这里就不细说了,详情可以百度。
Cloudflare Workers是一家代码部署网站,在这个网站上你可以将你的代码部署在上面,你不需要担心服务器,因为用户可以使用免费的套餐,没有流量限制,也不需要你维护服务器,我们待会需要用到这个网站的部署业务和流量
Rclone-用于云存储的rsync
Rclone是一个命令行程序,用于与以下文件同步文件和目录 通过rclone来联通Googledrive和Cloudflare Workers
Google云端硬盘目录索引 结合Cloudflare Workers和Google Drive的强大功能,您可以在Cloudflare Workers的浏览器中为文件建立索引。
项目地址goindex
安装rclone到本地,上面已经贴出链接
linux可以使用curl https://rclone.org/install.sh | sudo bash
第一次运行使用 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> remote
Type of storage to configure.
Choose a number from below, or type in your own value
[snip]
XX / Google Drive
\ "drive"
[snip]
Storage> drive
Google Application Client Id - leave blank normally.
client_id>
Google Application Client Secret - leave blank normally.
client_secret>
Scope that rclone should use when requesting access from drive.
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).
root_folder_id>
Service Account Credentials JSON file path - needed only if you want use SA instead of interactive login.
service_account_file>
Remote config
Use auto config?
* Say Y if not sure
* Say N if you are working on a remote or headless machine or Y didn't work
y) Yes
n) No
y/n> y
If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth
Log in and authorize rclone for access
Waiting for code...
Got code
Configure this as a team drive?
y) Yes
n) No
y/n> n
--------------------
[remote]
client_id =
client_secret =
scope = drive
root_folder_id =
service_account_file =
token = {"access_token":"XXX","token_type":"Bearer","refresh_token":"XXX","expiry":"2014-03-16T13:57:58.955387075Z"}
--------------------
y) Yes this is OK
e) Edit this remote
d) Delete this remote
y/e/d> y
按照上述提示就可以完成操作了 注意在Google授权的时候需要挂一个全局代理,不然让rclone接收不到回馈信息
输入rclone config file
就可以知道返回的token在哪个目录下了我们需要的token是refresh_token这一段复制保存下来留着备用
打开这个 网址
点击获取代码
选择你的谷歌账号登陆 然后接收rclone的许可 会返回给你一段代码把代码复制返回刚刚打开的网址 点击此处
点击建造就会在下面的文本框里面返回一大段我们需要的网站代码复制,然后打开
Cloudflare Workers 前面说过他的网站了,这里就不赘述了
注册并且登陆
到这里网站已经部署好了 你就可以不用挂代理也能下载Googledrive的文件了 推荐晚上下载,去避开高峰期