Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gclone 1.55 #50

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@

# Dependency directories (remove the comment below to include it)
vendor/

builds/
67 changes: 49 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,83 @@

gclone
====
English [简体中文](https://github.com/donwa/gclone/blob/master/README_zh.md)
English [简体中文](https://github.com/tomyummmm/gclone/blob/master/README_zh.md)


A modified version of the [rclone](//github.com/rclone/rclone)
Provide dynamic replacement sa file support for google drive operation
Provide dynamic replacement SA file support for google drive operation.
All other functions are the same as rclone.

This version includes PR#38 in original gclone [filepath end with slash /](https://github.com/donwa/gclone/pull/38)

## installation
```
bash <(wget -qO- https://git.io/gclone.sh)
```

```
// View version information
gclone version
```

## Instructions
### 1.service_account_file_path Configuration
add `service_account_file_path` Configuration.For dynamic replacement service_account_file(sa file). Replace configuration when `rateLimitExceeded` error occurs
### 1. service_account_file_path Configuration
Add `service_account_file_path` Configuration. For dynamic replacement service_account_file(SA file). Replaces SA file when `rateLimitExceeded` error occurs to bypass 750GB limit.

`rclone.conf` example:
```
[gc]
type = drive
scope = drive
service_account_file = /root/accounts/1.json
service_account_file_path = /root/accounts/
service_account_file_path = /root/accounts/ <------- (Important) Add this in configuration
root_folder_id = root
```
`/root/accounts/` Folder contains multiple access and edit permissions ***service account file(*.json)***.

### 2.Support incoming id
`/root/accounts/` Folder contains multiple access and edit permissions ***service account file (x.json)***.
Once set up, when `gclone` sees `rateLimitExceeded` error, it will automatically change SA file, seamlessly bypassing the limit in real-time.

### 2. Use gc-local.bat provided for ease of use and operation of gclone. (Windows only)
Read the instructions [here](https://telegra.ph/How-to-use-GC-Remote-and-Localbat-08-21) written by me.
You can find the original [repository](https://github.com/tomyummmm/gclone-batch-file) written by me.

## Features
### 1. Supports Folder ID
If the original rclone is across team disks or shared folders, multiple configuration drive letters are required for operation.
gclone supports incoming id operation

gclone supports Folder ID operations
```
gclone copy gc:{folde_id1} gc:{folde_id2} --drive-server-side-across-configs
gclone copy gc:{folder_id1} gc:{folder_id2} --drive-server-side-across-configs
```
folde_id1 can be:Common directory, shared directory, team disk.
folder_id1 can be: common directory, shared directory, team drive.

```
gclone copy gc:{folde_id1} gc:{folde_id2}/media/ --drive-server-side-across-configs

gclone copy gc:{folder_id1} gc:{folder_id2}/media/ --drive-server-side-across-configs
```

```
gclone copy gc:{share_fiel_id} gc:{folde_id2} --drive-server-side-across-configs
gclone copy gc:{shared_folder_id} gc:{folder_id2} --drive-server-side-across-configs
```

### 2. Direct Copy with file ID
`id` operations: common directory, shared directory, team drive.
```
gclone copy gc:{shared_file_id} gc:{folder_id2} --drive-server-side-across-configs
```

Supports {Folder ID} proceeding filepaths
```
gclone copy gc:{shared_file_id} gc:{Team Drive ID}/media/ --drive-server-side-across-configs
```



## Code edited
### All additional code that makes gclone run is encased. Most of the code edited is in drive.go inside \backend\drive
```
//------------------------------------------------------------
// 如果存在 ServiceAccountFilePath,调用 changeSvc, 重试
// If ServiceAccountFilePath exists, call changeSvc and try again
if(f.opt.ServiceAccountFilePath != ""){
f.waitChangeSvc.Lock()
f.changeSvc()
f.waitChangeSvc.Unlock()
return true, err
}
//------------------------------------------------------------
```
10 changes: 4 additions & 6 deletions README_zh.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@

gclone
====
[English](https://github.com/donwa/gclone/blob/master/README.md) 简体中文
简体中文 [English](https://github.com/tomyummmm/gclone/blob/master/README.md)


一个[rclone](//github.com/rclone/rclone) 的修改版.
为Google Drive操作增加自动切换账户和命令行根目录id操作支持.
其他功能与原版rclone相同.
## 安装
```
bash <(wget -qO- https://git.io/gclone.sh)
```


```
// 查看版本信息
Expand All @@ -20,6 +17,7 @@ gclone version
## 操作说明
### 1.service_account_file_path配置
添加`service_account_file_path`配置.用于动态替换service_account_file(sa文件).实现`rateLimitExceeded`错误时,替换当前用户,绕过750G限制.

`rclone.conf`文件示例:
```
[gc]
Expand All @@ -29,7 +27,7 @@ service_account_file = /root/accounts/1.json
service_account_file_path = /root/accounts/ <------- (核心)添加了这个配置
root_folder_id = root
```
其中`/root/accounts/`文件夹中存放了多个访问和编辑权限相同的service account file(*.json).
其中`/root/accounts/`文件夹中存放了多个访问和编辑权限相同的***service account file (x.json)***.
配置完成后.只要是`gclone`对`gc:`进行操作,出现`rateLimitExceeded`错误时,都会自动更换sa文件,实现无缝绕过限制.


Expand Down
4 changes: 3 additions & 1 deletion backend/all/all.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
_ "github.com/rclone/rclone/backend/cache"
_ "github.com/rclone/rclone/backend/chunker"
_ "github.com/rclone/rclone/backend/crypt"
_ "github.com/donwa/gclone/backend/drive"
_ "github.com/tomyummmm/gclone/backend/drive"
_ "github.com/rclone/rclone/backend/dropbox"
_ "github.com/rclone/rclone/backend/fichier"
_ "github.com/rclone/rclone/backend/ftp"
Expand All @@ -31,10 +31,12 @@ import (
_ "github.com/rclone/rclone/backend/putio"
_ "github.com/rclone/rclone/backend/qingstor"
_ "github.com/rclone/rclone/backend/s3"
_ "github.com/rclone/rclone/backend/seafile"
_ "github.com/rclone/rclone/backend/sftp"
_ "github.com/rclone/rclone/backend/sharefile"
_ "github.com/rclone/rclone/backend/sugarsync"
_ "github.com/rclone/rclone/backend/swift"
_ "github.com/rclone/rclone/backend/tardigrade"
_ "github.com/rclone/rclone/backend/union"
_ "github.com/rclone/rclone/backend/webdav"
_ "github.com/rclone/rclone/backend/yandex"
Expand Down
Loading