google drive无限网盘,配合cloudflare高速下载,访问。


准备

当然你首先要有Google和cloudflare账号,自行注册。

使用限制

cloudflare wokers一天10万请求限制
google drive 下载10T/24h(大佬说的)
google api 调用限制

注册Google无限网盘

提供几个个注册网址,注册要多等一会儿,不要重复提交
网上一搜一大把。

无限网盘注册1
无限网盘注册2
无限网盘注册3

无限网盘注册

rclone获取账号 opn登录

注意

需要 真·全局代理 ,否则最后一步获取信息会失败。我注册时使用 ShadowsocksRv2rayN 均失败,最后用 SSTap 成功。或者利用 VPS 获取登录信息也可以。
附上两个免费临时使用的 VPS

安装 rclone 对应的客户端

  1. 下载rclone客户端

下载网址rclone客户端
下载太慢,附上win64位客户端

rclone下载

  1. 解压到任意目录, 文件管理器目录栏中输入 cmd 启动命令行,
    输入 rclone config 进行配置

  2. 新建配置, 选择 n ,然后给配置随便取一个名字

    e) Edit existing remote
    n) New remote
    d) Delete remote
    r) Rename remote
    c) Copy remote
    s) Set configuration password
    q) Quit config
    n/s/q> n
    name> goole drive 
  3. 选择 13 Google Drive

    .....
    13 / Google Drive
    \ "drive"
    ......
    Storage> 13
  4. 输入应用 client_id client_secret

  • 可直接 回车 用 rclone 官方内置的项目,于别人共用Google API可能会很慢
  • 自行创建Google项目,(推荐,Google API调研上限,自用肯定用不完)
    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>

    创建Google项目:(可跳过)

    如果用 rclone 官方内置的项目,跳过本步骤
  1. 登录 Google API

  2. 新建项目 取个名称 创建

  3. 左上角切换到你刚刚创建的项目

  4. 左侧栏切换到到 OAuth 同意屏幕 选择 内部、外部 都可以 然后给应用随便取一个名字 保存

  5. 访问项目凭据

创建凭据 选择 OAuth 客户端ID

选择其他
OAuth 客户端ID

保存OAuth 客户端ID(即client_id)和密钥(即client_secret)
OAuth 客户端ID和密钥

  1. 继续配置rclone, 允许rclone的权限,全部权限 选择 1

    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
  2. 网盘根目录, 访问Google共享云端硬盘 访问自己的共享网盘的根目录,然后网址最后一段 字符就是 根目录地址 如图

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>xxxxx
  1. 储存凭据JSON文件路径,默认即可,直接 回车

    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>
  2. 编辑高级配置,默认即可,不编辑配置,直接 回车

    Edit advanced config? (y/n)
    y) Yes
    n) No (default)
    y/n> n
  3. 远程配置, 重点

  • 如果是使用本地机获取 rclone 配置,默认自动配置,回打开网页授权即可。
  • 如果是使用 vps 获取,选择 n 手动获取,然后访问提供的网址

授权,将得到的 verification code 输入即可

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>
  1. 选择自己的网盘

    Choose a number from below, or type in your own value
    1 / xxxxxx
    \ "xxxxxxxx"
    Enter a Team Drive ID> 1
  2. 保存得到 的 client_id client_secret root_folder_id refresh_token

    [cfdrive]
    type = drive
    client_id = xxxxx
    client_secret = xxx
    scope = drive
    root_folder_id = xxx
    token = {"access_token":"xxxxxxxxxxx","token_type":"Bearer","refresh_token":"xxxxxxxxxxxx":"2020-xx-xxTxx:xx:xx.xxxxxx+xx:xx"}
    team_drive = 0AGb_5t1PlgFlUk9PVA

部署cloudflare workers

开始搭建
填写自己喜爱的二级域名然后创建worker

进入github项目index.js 复制代码。

清除hello world示范代码后粘贴进去。然后修改开头的

var authConfig = {
    "siteName": "GoIndex", // 网站名称
    "root_pass": "123456",  // 根目录密码,优先于.password
    "version" : "1.0.6", // 程序版本
    "theme" : "material", // material  classic 
    "client_id": "xxxxx", //client_id
    "client_secret": "xxxxxx",  //client_secret
    "refresh_token": "", // 授权 token
    "root": "root" // 根目录ID

访问部署的cloudflare workers

后续使用

畅快使用

修改访问域名为自己的域名

  • 方法一
    域名 DNS 接入cloudflare,域名管理页面 -> workers ->添加路由

  • 方法二
    域名 CNAME or A 接入cloudflare第三方,然后域名解析 CNAMEworkers 项目

可参考cloudflare自定义IP加速网站

Google网页版上传

上传文件,直接使用网页版 的,感觉还不错

cloudflare访问和下载

访问 cloudflare workers 项目提供的网址即可

加密文件夹

在某个文件夹下添加 .password 文件,里面写入密码,即可加密该文件夹。注意文件必须以 UTF8NoBOM 编码,且密码前后不能有空格或空行,Windows 下可通过以下方式生成:

文件夹下按住 Shift 键的同时,鼠标右击文件夹空白处,选择 在此处打开 Powershell 窗口(S),接着执行以下命令,其中 1234 便是密码。

'1234' | Out-File -FilePath .password -Encoding ascii -NoNewline

然后将 .password 文件上传到要加密的文件夹

添加描述

在某个文件夹下添加 README.md 文件,里面按照 markdown 格式写描述,打卡该文件夹网址时下方会有相关描述。