Gclone和Fclone基于Rclone的魔改版支持分享链接转存及突破750G限制

介绍

GcloneFclone都是基于Rclone的魔改版本,功能与原版Rclone相同,另增加了一些比较实用的功能;

  • 支持服务端直接转存他人分享的文件及文件夹;
  • 支持突破Google Drive单账号每日750G限制,需要搭配Service Account使用;
  • 目前谷歌对Google Drive更新了限制,团队盘每日转出限制20TB,个人盘每日转出限制2TB

安装 Gclone

GitHub项目:https://github.com/donwa/gclone
GitHub中选择需要的Gclone版本,然后在本地解压得到名为gclone的文件
然后将得到的gclone文件上传至服务器/usr/bin目录下
然后赋予gclone权限

chmod +x /usr/bin/gclone

安装 Fclone

GitHub项目:https://github.com/mawaya/rclone
GitHub中选择需要的Fclone版本,然后在本地解压得到名为fclone的文件
然后将得到的fclone文件上传至服务器/usr/bin目录下
赋予fclone权限

chmod +x /usr/bin/fclone

使用

示例:
gclone copy gc:{目录1的id} gc:{目录2的id} --drive-server-side-across-configs
gclone copy gc:{共享目录id} gc:{团队盘id}/media/ --drive-server-side-across-configs
gclone copy gc:{共享文件的id} gc:{目录2的id} --drive-server-side-across-configs
gclone copy gc:{共享文件的id} gc:{团队盘id}/media/ --drive-server-side-across-configs
说明:
{目录id}可以是他人分享的单独文件也可以是文件夹
分享链接一般是这样的:https://drive.google.com/drive/folders/XXXXXX
最后面的一串字符XXXXXX既是分享ID
关于突破750G需要使用GoogleService Account服务,过程有些复杂,如果没需求就不用弄了;
需要的话可以自行Google教程,Service Account100个文件最好保存到本地,方便以后使用;
其它:
Fclone可以使用以下命令快速传输;
--drive-server-side-across-configs --stats=1s --stats-one-line -vP --checkers=256 --transfers=256 --drive-pacer-min-sleep=1ms --check-first

配置

如果有Service Account100个文件的话,就先建立以下目录,然后上传文件到accounts目录下

mkdir /root/AutoRclone
mkdir /root/AutoRclone/accounts

如果没有Service Account就略过,直接开始配置Rclone即可;
输入rclone config命令开始配置:

详细配置过程 - 展开查看详情

n) New remote
s) Set configuration password
q) Quit config
n/s/q> n   # 输入n回车,新建配置
name> GD   # 新建配置的名称,自行设定
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 / Dropbox
   \ "dropbox"
 9 / Encrypt/Decrypt a remote
   \ "crypt"
10 / FTP Connection
   \ "ftp"
11 / Google Cloud Storage (this is not Google Drive)
   \ "google cloud storage"
12 / Google Drive
   \ "drive"
13 / Google Photos
   \ "google photos"
14 / Hubic
   \ "hubic"
15 / JottaCloud
   \ "jottacloud"
16 / Koofr
   \ "koofr"
17 / Local Disk
   \ "local"
18 / Mega
   \ "mega"
19 / Microsoft Azure Blob Storage
   \ "azureblob"
20 / Microsoft OneDrive
   \ "onedrive"
21 / OpenDrive
   \ "opendrive"
22 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
   \ "swift"
23 / Pcloud
   \ "pcloud"
24 / Put.io
   \ "putio"
25 / QingCloud Object Storage
   \ "qingstor"
26 / SSH/SFTP Connection
   \ "sftp"
27 / Union merges the contents of several remotes
   \ "union"
28 / Webdav
   \ "webdav"
29 / Yandex Disk
   \ "yandex"
30 / http Connection
   \ "http"
31 / premiumize.me
   \ "premiumizeme"
Storage> 12       # 选择需要挂载的网盘类型
** 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>        # 默认直接回车,或者输入自己的OAuth ID
Google Application Client Secret
Setting your own is recommended.
Enter a string value. Press Enter for the default ("").
client_secret>    # 默认直接回车,或者输入自己的OAuth秘锁
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> # 直接回车,如果使用Service Account就填写其中一个文件的绝对路径即可:/root/AutoRclone/accounts/0a5af037763bdab70e3a7094d02ec4bd37f8db94.json
Service Account Credentials JSON file path .

Enter a string value. Press Enter for the default ("").
service_account_file_path> 直接回车,如果使用Service Account就填写这个路径:/root/AutoRclone/accounts/
Edit advanced config? (y/n)
y) Yes
n) No (default)
y/n> n                    # 选择n 不使用高级配置
Remote config
Configure this as a team drive?
y) Yes
n) No (default)
y/n> y                     # 选择n不加载团队盘,选择y加载团队盘
Fetching team drive list...
Choose a number from below, or type in your own value
 1 / 网盘01
   \ "0AFZFXMn1uKs2Uk9PVA"
 2 / 网盘05
   \ "0AI3nH3Vf8NWIUk9PVA"
 3 / 网盘02
   \ "0ADYACmKjlU3JUk9PVA"
Enter a Team Drive ID> # 选择你的团队盘编号
y) Yes this is OK
e) Edit this remote
d) Delete this remote
y/e/d> y       # 选择y回车
Current remotes:

Name                 Type
====                 ====
网盘01             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回车,保存配置退出

最后修改:2024 年 07 月 01 日

发表评论

17 条评论

  1. Zynismus16

    博主,请问使用gclone+sa账户,也需要将sa账户添加进团盘嘛

  2. 秋歌

    请问贵站goindex怎么指定IP的啊,能赐教一下吗?谢谢

    1. sunpma
      @秋歌

      使用CNAME方式接入CF的CDN,官方只能DNS接入,二级服务商可以CNAME接入
      https://cdn.bnxb.com

      1. 秋歌
        @sunpma

        感谢,已经搞定

  3. gcone

    大佬,为什么我在团队盘里拷贝,很多文件都报错: Failed to copy: failed to make directory: googleapi: Error 404: File not found:

    1. sunpma
      @gcone

      应该是路径的命令写错了

  4. ivytech

    想问一下。转存别人分享的文件。它是在后台操作吗,还是需要ssh一直开着。有的文件几十G不可能一直等着吧

    1. sunpma
      @ivytech

      加上--drive-server-side-across-configs参数就行,端对端进行复制,不消耗服务器流量,速度能达到5G/秒左右,非常快

      1. ivytech
        @sunpma

        看了github说明。它说是团队盘。我是edu。可行吗(转存另一个学校的edu)

        1. sunpma
          @ivytech

          应该是可以的,你试试不就行了,端对端的复制Gclone和Rclone都支持的

          1. ivytech
            @sunpma

            好的,谢谢

  5. Sugar

    已经像博主那样配置好 可是没法用id操作 原生rclone那样的路径操作倒正常
    正常:gclone copy gc:abc gc: --drive-server-side-across-configs
    错误:gclone copy gc:1xfuvdgsmkjplWlcMx_WNZ08IrvmjcGEN gc: --drive-server-side-across-configs
    一直报这个错误 ERROR : : error reading source directory: directory not found

    1. sunpma
      @Sugar

      ID要加""或{}
      "1xfuvdgsmkjplWlcMx_WNZ08IrvmjcGEN"
      {1xfuvdgsmkjplWlcMx_WNZ08IrvmjcGEN}

      1. Sugar
        @sunpma

        原来如此 我还以为这个只是来表明示例变量用的 (ó﹏ò。)

  6. xiexie

    博主,你好。请教下你网站谷歌网盘资源能不能教下怎么转到自己的网盘去呀?想下载要一个一个点很麻烦。谢谢

    1. sunpma
      @xiexie

      没办法,这个是无限盘不能分享文件夹

      1. xiexie
        @sunpma

        好吧。资源很好~