Skip to content

Commit 219abc2

Browse files
committed
add 21vianet,Google Drive
1 parent 73e4e4c commit 219abc2

File tree

907 files changed

+203198
-71036
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

907 files changed

+203198
-71036
lines changed

Readme-zh-CN.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
# OneDriveUploader
1+
# LightUploader
22

3-
萌咖大佬写了一个 [非常好的版本](https://github.com/MoeClub/OneList/tree/master/OneDriveUploader) ,可惜并没有开源,而且已经好久都没有更新了。这个项目作为从 [DownloadBot](https://github.com/gaowanliang/DownloadBot) 中独立出来的一个简易上传工具,使得上传到OneDrive更加方便
3+
萌咖大佬写了一个 [非常好的版本](https://github.com/MoeClub/OneList/tree/master/OneDriveUploader) ,可惜并没有开源,而且已经好久都没有更新了。这个项目作为从 [DownloadBot](https://github.com/gaowanliang/DownloadBot) 中独立出来的一个简易上传工具,旨在用更轻量化的方式让在各种平台都能快速的向各个网络硬盘上传数据
44

5-
6-
- 支持 国际版, 个人版(家庭版).
5+
- 支持 OneDrive 国际版, 个人版(家庭版),世纪互联,Google Drive(测试版,下面的命令并未完全支持).
76
- 支持上传文件和文件夹到指定目录,并保持上传前的目录结构.
87
- 支持命令参数使用, 方便外部程序调用.
98
- 支持自定义上传分块大小.
@@ -13,31 +12,32 @@
1312
- 支持通过Telegram Bot实时监控上传进度,方便使用全自动下载脚本时对上传的实时监控
1413

1514
## 授权
16-
### 通过下面URL登录 (右键新标签打开)
17-
#### 国际版, 个人版(家庭版)
18-
[https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=ad5e65fd-856d-4356-aefc-537a9700c137&response_type=code&redirect_uri=http://localhost/onedrive-login&response_mode=query&scope=offline_access%20User.Read%20Files.ReadWrite.All](https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=ad5e65fd-856d-4356-aefc-537a9700c137&response_type=code&redirect_uri=http://localhost/onedrive-login&response_mode=query&scope=offline_access%20User.Read%20Files.ReadWrite.All)
15+
详见[wiki](https://github.com/gaowanliang/LightUploader/wiki)
1916

2017

2118
### 初始化配置文件
2219
```bash
23-
# 国际版
24-
OneDriveUploader -a "url"
25-
# 国际版,并使用中文语言包
26-
OneDriveUploader -a "url" -l zh-CN
27-
# 个人版(家庭版)
28-
OneDriveUploader -a "url" -v 1
29-
# 中国版(世纪互联) 目前设计中,暂不可用
30-
OneDriveUploader -a "url" -v 2
20+
# OneDrive 国际版
21+
LightUploader -a "url"
22+
# OneDrive 国际版,并使用中文语言包
23+
LightUploader -a "url" -l zh-CN
24+
# OneDrive 个人版(家庭版)
25+
LightUploader -a "url" -v 1
26+
# OneDrive 中国版(世纪互联),并使用中文语言包
27+
LightUploader -a "url" -v 2
3128

3229
# 在浏览器地址栏中获取以 http://loaclhost 开头的整个url内容
3330
# 将获取的完整url内容替换命令中的 url 三个字母
3431
# 每次产生的 url 只能用一次, 重试请重新获取 url
3532
# 此操作将会自动初始化的配置文件
33+
34+
# Google Drive
35+
LightUploader -a "url" -v 3
3636
```
3737

3838
## 使用
3939
```c
40-
Usage of OneDriveUploader:
40+
Usage of LightUploader:
4141
-a string
4242
// 初始化授权
4343
Setup and Init auth.json.
@@ -61,22 +61,22 @@ Usage of OneDriveUploader:
6161
-uid string
6262
// 使用Telegram机器人实时监控上传,此处需填写接收人的userID,形如123456789
6363
-m int
64-
// 选择模式,0为替换OneDrive中同名文件,1为跳过,默认为0
64+
// 选择模式,0为替换网盘中同名文件,1为跳过,默认为0
6565
-v int
66-
// 选择版本,其中0为国际版,1为个人版(家庭版),默认为0
66+
// 选择版本,其中0为 OneDrive 国际版,1为 OneDrive 个人版(家庭版),2为 OneDrive 世纪互联,3为Google Drive,默认为0
6767
```
6868

6969
## 配置
7070
```jsonc
7171
{
72+
// 网盘类型
73+
"Drive":"OneDrive",
7274
// 授权令牌
7375
"RefreshToken": "1234564567890ABCDEF",
7476
// 最大线程数.(同时上传文件的数量)
7577
"ThreadNum": 2,
7678
// 最大上传分块大小.(每次上传文件的最大分块大小,网络不好建议调低. 单位:MB)
7779
"BlockSize": 10,
78-
// 最大单文件大小.(目前: 个人版(家庭版)单文件限制为100GB; 其他版本单文件限制为15GB,微软将逐步更新为100GB. 单位:GB)
79-
"SigleFile": 100,
8080
// 如果是中国版(世纪互联), 此项应为 true.
8181
"MainLand": false,
8282
//软件语言
@@ -96,31 +96,31 @@ Usage of OneDriveUploader:
9696
# 一些示例:
9797

9898
# 将同目录下的 mm00.jpg 文件上传到 OneDrive 网盘根目录
99-
OneDriveUploader -c xxx.json -f "mm00.jpg"
99+
LightUploader -c xxx.json -f "mm00.jpg"
100100

101101
# 将同目录下的 Download 文件夹上传到 OneDrive 网盘根目录
102-
OneDriveUploader -c xxx.json -f "Download"
102+
LightUploader -c xxx.json -f "Download"
103103

104104
# 将同目录下的 Download 文件夹上传到 OneDrive 网盘Test目录中
105-
OneDriveUploader -c xxx.json -f "Download" -r "Test"
105+
LightUploader -c xxx.json -f "Download" -r "Test"
106106

107107
# 将同目录下的 Download 文件夹上传到 OneDrive 网盘根目录中, 使用 10 线程
108-
OneDriveUploader -c xxx.json -t 10 -f "Download"
108+
LightUploader -c xxx.json -t 10 -f "Download"
109109

110110
# 将同目录下的 Download 文件夹上传到 OneDrive 网盘根目录中, 使用 10 线程,并跳过同名文件
111-
OneDriveUploader -c xxx.json -t 10 -f "Download" -m 1
111+
LightUploader -c xxx.json -t 10 -f "Download" -m 1
112112

113113
# 将同目录下的 Download 文件夹上传到 OneDrive 网盘根目录中, 使用 10 线程,同时设置超时时间为30秒
114-
OneDriveUploader -c xxx.json -t 10 -f "Download" -to 30
114+
LightUploader -c xxx.json -t 10 -f "Download" -to 30
115115

116116
# 将同目录下的 Download 文件夹上传到 OneDrive 网盘根目录中, 使用 10 线程,同时使用 Telegram Bot 实时监控上传进度
117-
OneDriveUploader -c xxx.json -t 10 -f "Download" -tgbot "123456:xxxxxxxx" -uid 123456789
117+
LightUploader -c xxx.json -t 10 -f "Download" -tgbot "123456:xxxxxxxx" -uid 123456789
118118

119119
# 将同目录下的 Download 文件夹上传到 OneDrive 网盘根目录中, 使用 10 线程,同时使用配置文件中的 Telegram Bot 参数载入程序实时监控上传进度(前提是配置文件中含有Telegram Bot 的参数)
120-
OneDriveUploader -c xxx.json -t 10 -f "Download" -tgbot "1"
120+
LightUploader -c xxx.json -t 10 -f "Download" -tgbot "1"
121121

122122
# 将同目录下的 Download 文件夹上传到 OneDrive 网盘根目录中, 使用 15 线程, 并设置分块大小为 20M
123-
OneDriveUploader -c xxx.json -t 15 -b 20 -f "Download"
123+
LightUploader -c xxx.json -t 15 -b 20 -f "Download"
124124

125125
```
126126

Readme.md

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[简体中文](Readme-zh-CN.md)
2-
# OneDriveUploader
2+
# LightUploader
33

4-
MoeClub wrote a [very good version](https://github.com/MoeClub/OneList/tree/master/OneDriveUploader), but unfortunately it's not open source and hasn't been updated in a while. This project is a simple upload tool separate from [DownloadBot](https://github.com/gaowanliang/DownloadBot), making it easier to upload.
4+
MoeClub wrote a [very good version](https://github.com/MoeClub/OneList/tree/master/OneDriveUploader), but unfortunately it's not open source and hasn't been updated in a while. This project is a simple upload tool separate from [DownloadBot](https://github.com/gaowanliang/DownloadBot), designed to be a lightweight way to quickly upload data to various network drives on all platforms.
55

66
## Features
77

8-
- Supports Business, Personal (Home) versions.
8+
- Supports OneDrive Business, Personal (Home) versions, 21vianet (CN) version, Google Drive (Beta).
99
- Support for uploading files and folders to specified directories, keeping the directory structure as it was before the upload.
1010
- Supports the use of command parameters for external applications.
1111
- Support for customising the upload chunk size.
@@ -16,35 +16,37 @@ MoeClub wrote a [very good version](https://github.com/MoeClub/OneList/tree/mast
1616

1717

1818
## Authorize
19-
### Login via the following URL (right click to open a new tab)
20-
#### Business, Personal (Home) versions
21-
[https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=ad5e65fd-856d-4356-aefc-537a9700c137&response_type=code&redirect_uri=http://localhost/onedrive-login&response_mode=query&scope=offline_access%20User.Read%20Files.ReadWrite.All](https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=ad5e65fd-856d-4356-aefc-537a9700c137&response_type=code&redirect_uri=http://localhost/onedrive-login&response_mode=query&scope=offline_access%20User.Read%20Files.ReadWrite.All)
19+
See [wiki](https://github.com/gaowanliang/LightUploader/wiki) for details
2220

2321

2422

2523
### Initialization profile
2624
```bash
27-
# Business
28-
OneDriveUploader -a "url"
25+
# OneDrive Business
26+
LightUploader -a "url"
2927

30-
# Business, and use Chinese language pack
31-
OneDriveUploader -a "url" -l zh-CN
28+
# OneDrive Business, and use Chinese language pack
29+
LightUploader -a "url" -l zh-CN
3230

33-
# Personal (Home)
34-
OneDriveUploader -a "url" -v 1
31+
# OneDrive Personal (Home)
32+
LightUploader -a "url" -v 1
3533

36-
# The China Version (Century Internet) is currently in design and is not available
37-
OneDriveUploader -a "url" -v 2
34+
# OneDrive 21vianet (CN) version, and use Chinese language pack
35+
LightUploader -a "url" -v 2 -l zh-CN
3836

3937
# Get the entire url in the browser address bar starting with http://loaclhost
4038
# Replace the full url with the three letters of the "url" in the command
4139
# Each url generated can only be used once, try again to retrieve the url
4240
# This action will automatically initialise the configuration file
41+
42+
# Google Drive
43+
LightUploader -a "url" -v 3
44+
4345
```
4446

4547
## Use
4648
```c
47-
Usage of OneDriveUploader:
49+
Usage of LightUploader:
4850
-a string
4951
//Setup and Init auth.json.
5052
-b string
@@ -67,14 +69,15 @@ Usage of OneDriveUploader:
6769
-uid string
6870
// Use the Telegram bot to monitor uploads in real time, here you need to fill in the recipient's userID, shaped like 123456789
6971
-m int
70-
// Select the mode, 0 is to replace the file with the same name in onedrive, 1 is to skip, the default is 0
72+
// Select the mode, 0 is to replace the file with the same name in cloud drive, 1 is to skip, the default is 0
7173
-v int
72-
// Select the version, where 0 is the Business version and 1 is the personal (home) version, the default is 0
74+
// Select the version, where 0 is the OneDrive Business version and 1 is the OneDrive Personal (Home) version, 2 is OneDrive 21vianet (CN) version, 3 is Google Drive, the default is 0
7375
```
7476

7577
## Config
7678
```jsonc
7779
{
80+
"Drive":"OneDrive",
7881
// Authorisation tokens
7982
"RefreshToken": "1234564567890ABCDEF",
8083
// Maximum number of threads. (Number of simultaneous file uploads)
@@ -102,32 +105,32 @@ Note that when a configuration file is used at the same time and the parameters
102105
# Some examples:
103106

104107
# Upload the mm00.jpg file from the same directory to the root of the OneDrive
105-
OneDriveUploader -c xxx.json -f "mm00.jpg"
108+
LightUploader -c xxx.json -f "mm00.jpg"
106109

107110
# Upload the Download folder from the same directory to the root of the OneDrive
108-
OneDriveUploader -c xxx.json -f "Download"
111+
LightUploader -c xxx.json -f "Download"
109112

110113
# Upload the Download folder from the same directory to the Test directory of the OneDrive
111-
OneDriveUploader -c xxx.json -f "Download" -r "Test"
114+
LightUploader -c xxx.json -f "Download" -r "Test"
112115

113116
# Upload the Download folder from the same directory to the root of the OneDrive, using 10 threads
114-
OneDriveUploader -c xxx.json -t 10 -f "Download"
117+
LightUploader -c xxx.json -t 10 -f "Download"
115118

116119
# Upload the download folder in the same directory to the root directory of onedrive, use 10 threads, and skip the file with the same name
117-
OneDriveUploader -c xxx.json -t 10 -f "Download" -m 1
120+
LightUploader -c xxx.json -t 10 -f "Download" -m 1
118121

119122
# Upload the download folder in the same directory to the root directory of onedrive, use 10 threads, and set the timeout to 30 seconds
120-
OneDriveUploader -c xxx.json -t 10 -f "Download" -to 30
123+
LightUploader -c xxx.json -t 10 -f "Download" -to 30
121124

122125
# Upload the Download folder from the same directory to the root of the OneDrive, using 10 threads, while using Telegram Bot to monitor the progress of the upload in real time
123-
OneDriveUploader -c xxx.json -t 10 -f "Download" -tgbot "123456:xxxxxxxx" -uid 123456789
126+
LightUploader -c xxx.json -t 10 -f "Download" -tgbot "123456:xxxxxxxx" -uid 123456789
124127

125128
# Upload the download folder in the same directory to the root directory of onedrive network disk, use 10 threads, and use the telegram BOT parameter loader in the configuration file to monitor the upload progress in real time (provided that the configuration file contains the parameters of telegram BOT)
126-
OneDriveUploader -c xxx.json -t 10 -f "Download" -tgbot "1"
129+
LightUploader -c xxx.json -t 10 -f "Download" -tgbot "1"
127130

128131

129132
# Upload the Download folder from the same directory to the root of the OneDrive, using 15 threads, and setting the chunk size to 20M
130-
OneDriveUploader -c xxx.json -t 15 -b 20 -f "Download"
133+
LightUploader -c xxx.json -t 15 -b 20 -f "Download"
131134
```
132135

133136
## Note

go.mod

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ require (
66
github.com/BurntSushi/toml v0.3.1
77
github.com/buger/jsonparser v1.0.0
88
github.com/gosuri/uilive v0.0.4
9-
github.com/hedzr/cmdr v1.7.43
9+
github.com/hedzr/cmdr v1.7.43 // indirect
1010
github.com/mattn/go-isatty v0.0.12 // indirect
1111
github.com/nicksnyder/go-i18n/v2 v2.1.2
12-
golang.org/x/sys v0.0.0-20210324051608-47abb6519492 // indirect
12+
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4
13+
golang.org/x/oauth2 v0.0.0-20210413134643-5e61552d6c78
1314
golang.org/x/text v0.3.6
15+
google.golang.org/api v0.45.0
1416
)

0 commit comments

Comments
 (0)