A lightweight, universal cloud drive upload tool for all platforms

Overview

简体中文

LightUploader

MoeClub wrote a very good version, 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, designed to be a lightweight way to quickly upload data to various network drives on all platforms.

Features

  • Supports OneDrive Business, Personal (Home) versions, 21vianet (CN) version, Google Drive.
  • Support for uploading files and folders to specified directories, keeping the directory structure as it was before the upload.
  • Supports the use of command parameters for external applications.
  • Support for customising the upload chunk size.
  • Supports multi-threaded uploads (multiple files at the same time).
  • Support for dynamically adjusting the number of retries according to the file size.
  • Supports skipping the existing files with the same name in the OneDrive.
  • Support for real-time monitoring of upload progress via Telegram Bot, for easy monitoring of uploads when using fully automated download scripts.

Authorize

See wiki for details

Initialization profile

# OneDrive Business
LightUploader -a "url"

# OneDrive Business, and use Chinese language pack
LightUploader -a "url" -l zh-CN

# OneDrive Personal (Home)
LightUploader -a "url" -v 1

# OneDrive 21vianet (CN) version, and use Chinese language pack
LightUploader -a "url" -v 2 -l zh-CN

# Get the entire url in the browser address bar starting with http://loaclhost
# Replace the full url with the three letters of the "url" in the command
# Each url generated can only be used once, try again to retrieve the url
# This action will automatically initialise the configuration file

# Google Drive
LightUploader -v 3

Use

Usage of LightUploader:
  -a string
        //Setup and Init auth.json.
  -b string
        //Set block size. [Unit: M; 5<=b<=60;] (default "10")
  -c string
        //Config file.

  -r string
        //Upload to reomte path.
  -l string
        // Software language
  -f string
        // *Necessary parameters, file or folder to upload
  -t string
        // Number of threads, number of files uploaded at the same time. Default: 3
  -to int
        // The timeout time of a single packet is 60s by default
  -tgbot string
        //Use the Telegram bot to monitor uploads in real time, here you need to fill in the access token of the bot, e.g. 123456789:xxxxxxxxxx, use double quotes to wrap it
  -uid string
        // Use the Telegram bot to monitor uploads in real time, here you need to fill in the recipient's userID, shaped like 123456789
  -m int
        // Select the mode, 0 is to replace the file with the same name in cloud drive, 1 is to skip, the default is 0
  -v int
        // 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

Config

{
    "Drive":"OneDrive",
    // Authorisation tokens
    "RefreshToken": "1234564567890ABCDEF",
    // Maximum number of threads. (Number of simultaneous file uploads)
    "ThreadNum": 2,
    // Maximum upload chunk size. (The maximum chunk size for each file upload, it is recommended to reduce it if the network is not good. Unit: MB)
    "BlockSize": 10,
    // Maximum single file size. (Currently: 100GB single file limit for Personal Edition (Home Edition); 15GB single file limit for other editions, Microsoft will update to 100GB over time. Unit: GB)
    "SigleFile": 100,
    // If this is the Chinese version (CenturyLink), this should be true.
    "MainLand": false,
    //Software language
    "Language": "zh-CN",
    //timeout
    "TimeOut": 60,
    //Telegram Bot key
    "BotKey": "",
    //Telegram User ID
    "UserID": ""
}

Note that when a configuration file is used at the same time and the parameters in the configuration file are not the default values, the parameters in the configuration file will be used by default, and when parameters are entered on the command line, the parameters currently entered on the command line will be used and the parameters in the configuration file will be changed. That is, the parameters in the command line take precedence over the parameters in the configuration file and will change the parameters in the configuration file.

Examples

# Some examples:

# Upload the mm00.jpg file from the same directory to the root of the OneDrive
LightUploader -c xxx.json -f "mm00.jpg"

# Upload the Download folder from the same directory to the root of the OneDrive
LightUploader -c xxx.json -f "Download" 

# Upload the Download folder from the same directory to the Test directory of the OneDrive
LightUploader -c xxx.json -f "Download" -r "Test"

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

# 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
LightUploader -c xxx.json -t 10 -f "Download" -m 1

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

# 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
LightUploader -c xxx.json -t 10 -f "Download" -tgbot "123456:xxxxxxxx" -uid 123456789

# 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)
LightUploader -c xxx.json -t 10 -f "Download" -tgbot "1"


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

Note

Returns 0 when there is no problem with the upload, which can be used as evidence of whether the upload has failed or not

Comments
  • OD报错

    OD报错

    panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x95641b]

    goroutine 1 [running]: main.DirSize.func1(0x7ffd5e48483f, 0x8, 0x0, 0x0, 0xb93ac0, 0xc00030a210, 0xc000233a80, 0x43d0ce) D:/program_data/go/LightUploader/main.go:241 +0x2b path/filepath.Walk(0x7ffd5e48483f, 0x8, 0xc000233a98, 0xc000233aa8, 0x768afa) D:/program_app/go/src/path/filepath/path.go:404 +0x6a main.DirSize(0x7ffd5e48483f, 0x8, 0xfcb820, 0x0, 0x0) D:/program_data/go/LightUploader/main.go:240 +0x66 main.main() D:/program_data/go/LightUploader/main.go:329 +0x107d

    opened by taiyi747 11
  • 尝试授权时提示报错

    尝试授权时提示报错

    panic: runtime error: index out of range [1] with length 0

    goroutine 1 [running]: main/graph/net/http.getAccessToken(0x7ffdee3a283d, 0x3e, 0x0, 0xaba01c, 0x2, 0x0, 0x0) D:/program_data/go/LightUploader/graph/net/http/OAuth2.go:115 +0xc41 main/graph/net/http.NewPassCheck(0x7ffdee3a283d, 0x3e, 0x0, 0xaba01c, 0x2, 0x0, 0x0) D:/program_data/go/LightUploader/graph/net/http/OAuth2.go:42 +0x92 main.ApplyForNewPass(0x7ffdee3a283d, 0x3e, 0x0, 0x5f, 0x0) D:/program_data/go/LightUploader/main.go:32 +0x101 main.main() D:/program_data/go/LightUploader/main.go:403 +0xc0d

    服务器是centos7

    opened by huankong233 2
  • 关于Google Driver上传的两个问题

    关于Google Driver上传的两个问题

    我根据您博客上的文章进行设置,成功设置了Google Driver的配置文件并且使用命令成功进行了手动上传,非常感谢您,但是在上传过程中出现了一些令人不悦的小问题,在这里想请问一下。 1.在上传时,无法使用-r参数设置上传的目录,只能上传至根目录,我不太清楚这个是不是目前的限制。 2.在上传时,除了上传我所需要的文件,另外它(Download bot)还在我Google Driver的根目录建立了一个同名文件夹。 3.我注意到您博客上的文章中使用“”将上传的文件和目标目录包覆了起来,我不太明白这样做的必要性,因为我尝试过不使用“”,发现也是同样可以使用的。

    最后附上为数不多的日志:/root/LightUploader -c xxxx.json -f "/path/bakfile" -r "/backup" /path/bakfile 开始上传,大小: xx KB2021/09/27 22:28:42 /bakfile /root /path `bakfile开始上传至Google Drive

    question 
    opened by MorningP 2
  • 同样上传出错

    同样上传出错

    cpu卡死后重启再上传显示: 2021/05/14 16:59:13 EOF panic: EOF

    goroutine 1 [running]: log.Panicln(0xc00003fdc8, 0x1, 0x1) D:/program_app/go/src/log/log.go:365 +0xac main.main() D:/program_data/go/onedrive/main.go:290 +0x1695

    opened by xiaoxinhuozhu 2
  • 大佬,这是什么问题

    大佬,这是什么问题

    LightUploader -c XXXX.json -f “/root/down/.rtorrent/犬夜叉/” panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x95781b]

    opened by KuYeHQ 1
  • GD初始化报错

    GD初始化报错

    [email protected]:~# LightUploader -v 3
    panic: message "googleDriveGetAccess" not found in language "en"
    
    goroutine 1 [running]:
    github.com/nicksnyder/go-i18n/v2/i18n.(*Localizer).MustLocalize(0xc0004673a0, 0xc0003afd78, 0x2, 0x2)
            D:/program_data/go/LightUploader/vendor/github.com/nicksnyder/go-i18n/v2/i18n/localizer.go:211 +0x79
    main.(*Loc).print(...)
            D:/program_data/go/LightUploader/i18n.go:136
    main.main()
            D:/program_data/go/LightUploader/main.go:392 +0x766
    

    https://imglink.win/image/2021/04/29/wnOn7.png

    opened by madlaxcb 1
  • 上传GD一段时间后报错

    上传GD一段时间后报错

    ovh法国机器,系统是ubuntu,上传GD一段时间后报错,试过几次了,看样子是发送TG信息的请求频率太高了?

    /root/LightUploader -c /root/[email protected] -t 1 -f "XXXX" -tgbot "XXXXXX" -uid XXXXX

    2022/03/09 14:43:47 Telegram Send Error:Too Many Requests: retry after 122
    panic: Telegram Send Error:Too Many Requests: retry after 122
    
    goroutine 1 [running]:
    log.Panicf({0xc0000de620, 0x22}, {0xc0017211d8, 0xc0017211c8, 0x3})
            D:/program_app/go/src/log/log.go:361 +0x67
    main.botSend({0x7ffc536bb31f, 0x95bbf8}, {0x7ffc536bb353, 0xc00013407e}, {0xc00049a7c0, 0x36})
            D:/program_data/go/LightUploader/main.go:218 +0x565
    main/googledrive.UploadAllFile({0xc000134050, 0x43}, {0xc001105d50, 0x1, 0x1}, 0xc0003a2400, 0xc0000001a0, {0xc000028180, 0x11}, 0xc000060280, ...)
            D:/program_data/go/LightUploader/googledrive/gdUpload.go:205 +0x183
    main/googledrive.UploadAllFile({0x7ffc536bb2ea, 0x2d}, {0x0, 0x0, 0x0}, 0xc0003a2400, 0xa, {0xc000028180, 0x11}, 0xc000060280, ...)
            D:/program_data/go/LightUploader/googledrive/gdUpload.go:253 +0xb6c
    main/googledrive.Upload({0x7ffc536bb2c5, 0x1c}, {0x7ffc536bb2ea, 0x2d}, 0x100000000000000, 0x98a888, 0x10, 0x10, {0x95bd94, 0x2}, ...)
            D:/program_data/go/LightUploader/googledrive/gdUpload.go:435 +0x414
    main.main()
            D:/program_data/go/LightUploader/main.go:375 +0x101d
    
    
    opened by madlaxcb 1
  • 无法上传整个文件夹

    无法上传整个文件夹

    panic: runtime error: slice bounds out of range [6:5]

    goroutine 43 [running]: main.main.func1({0x95ced6, 0x5}) D:/program_data/go/LightUploader/main.go:355 +0x188 main.restore.func1.2({0x95ced6, 0x5}) D:/program_data/go/LightUploader/main.go:133 +0x45 main.restore.func1({0xc000330e40, 0xb1}, {0xc00000e5c0, {0x95cce7, 0xd9e52226927933fa}}) D:/program_data/go/LightUploader/main.go:152 +0x645 created by main.restore D:/program_data/go/LightUploader/main.go:121 +0x80f

    opened by dongzi0712 1
  • 上传报错

    上传报错

    文件小于4MB,进入小文件通道,上传中 2021/12/19 10:33:50 无法还原 :EOF panic: 无法还原 :EOF

    goroutine 16 [running]: log.Panicf(0xc00027fa40, 0x10, 0xc000075a20, 0x1, 0x1) D:/program_app/go/src/log/log.go:358 +0xc7 main/api/restore/upload.(*RestoreService).SimpleUploadToOriginalLoc(0xc000006580, 0xc00001db00, 0x24, 0xc0000c2000, 0x760, 0xab4969, 0x7, 0xc000018140, 0xd, 0xc000283a10, ...) D:/program_data/go/LightUploader/api/restore/upload/onedriveRestore.go:112 +0xafe main.restore.func1(0xc000296770, 0xc00004d680, 0xc0002cbd30, 0xc0002ea840, 0xc000283bc0, 0xe, 0xc000283bce, 0x24, 0xc00027fe00, 0x18, ...) D:/program_data/go/LightUploader/main.go:131 +0x559 created by main.restore D:/program_data/go/LightUploader/main.go:110 +0x245

    文件以时间命名只有中文和数字 大小为7.67 MB (8,049,325 字节) 只有这一个出错了 而且文件大于4m

    opened by storybegin 6
  • linux 下无法上传

    linux 下无法上传

    Centos7 64 个人版 小文件提示:

    文件小于4MB,进入小文件通道,上传中   
    2021/08/22 15:05:16 无法还原 :EOF   
    panic: 无法还原 :EOF      
    

    大文件提示:

    文件: `xxx` 开始上传至OneDrive     
    账户:`xxx`    
    文件超过4MB,进入大文件通道     
    

    就退出了,也没有上传上去

    在Windows下就可以上传

    opened by tramsky996 2
Releases(v2.0.2-fix2)
Owner
高玩梁
私、気になります
高玩梁
A Remote Administration Tool made in golang. All controlled with a bot.

DISGORAT Information DISGORAT is a Remote Administration Tool fully made in golang. Change the Bottoken, webhook, guild id, channelid in main.go and y

Hima 8 Sep 17, 2022
Feishu/Lark Open API Go Sdk, Support ALL Open API and Event Callback.

lark 中文版 README Feishu/Lark Open API Go Sdk, Support ALL Open API and Event Callback. Created By Code Generation. Install go get github.com/chyroc/lar

chyroc 263 Nov 26, 2022
This slack-bot collects all @gophers notifications into one slack channel

slack-bot Slack bot copying reference to a ping to notifications channel The bot is designed to listen on messages containing specific tag, copy refer

Kyma Incubator 2 Apr 11, 2022
Discordo is a lightweight, secure, and feature-rich Discord terminal client.

discordo · [WIP] Discordo is a lightweight, secure, and feature-rich Discord terminal client. It is highly configurable and has a minimalistic user in

null 964 Dec 1, 2022
A lightweight way to mass delete old messages

discord-mass-delete A quick tool to retroactively delete all messages (or filter to specific channels / guilds), extracted from your Discord data back

liv 4 Feb 11, 2022
A lightweight operating system that allows Discord channels to essentially function as terminal interfaces

KuriOS KuriOS is an lightweight operating system that allows Discord channels to essentially function as terminal interfaces. As such, all permissions

Eduard Anton 1 Dec 31, 2021
Dlercloud-telegram-bot - A Telegram bot for managing your Dler Cloud account

Dler Cloud Telegram Bot A Telegram bot for managing your Dler Cloud account. Usa

Beta Kuang 1 Dec 30, 2021
A tool written in GO to demonstrate how bad actors utilize requests to spam Discord Users and launch large unsolicited DM Advertisement Campaigns

discord-mass-DM-GO A tool written in GO to demonstrate how bad actors utilize requests to spam Discord Users and launch large unsolicited DM Advertise

Vanshaj 1.7k Nov 11, 2022
Tool to summarize and report large exchange inflows, exchange outflows, mints, and burns.

What this is Tool to summarize and report large exchange inflows, exchange outflows, mints, and burns. Data is sourced from whale-alert and reported v

null 4 Nov 11, 2022
Discord-dl: a tool to archive discord channels

discord-dl discord-dl is a tool to archive discord channels. I think it's safe t

null 3 May 18, 2022
A lightweight, universal OneDrive upload tool for all platforms

简体中文 OneDriveUploader MoeClub wrote a very good version, but unfortunately it's not open source and hasn't been updated in a while. This project is a

高玩梁 257 Dec 5, 2022
"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Yandex Files

Website | Documentation | Download | Contributing | Changelog | Installation | Forum Rclone Rclone ("rsync for cloud storage") is a command-line progr

rclone 35.9k Dec 7, 2022
Download an upload large files to Google Drive (API v3)

gdriver gdriver is a command-line tool, written in Go, used for uploading and downloading large personal files from Google Drive (API v3). The tool pr

Marcin Tojek 67 Nov 30, 2022
upload to gdrive include shared drive

gdrive_uploader upload to gdrive include shared drive How to get go get github.com/heat1024/gdrive_uploader About credential You must set your client

ryu 3 Oct 6, 2022
provide api for cloud service like aliyun, aws, google cloud, tencent cloud, huawei cloud and so on

cloud-fitter 云适配 Communicate with public and private clouds conveniently by a set of apis. 用一套接口,便捷地访问各类公有云和私有云 对接计划 内部筹备中,后续开放,有需求欢迎联系。 开发者社区 开发者社区文档

null 23 May 8, 2022
Build for all Go-supported platforms by default, disable those which you don't want.

bagop Build for all Go-supported platforms by default, disable those which you don't want. Overview bagop is a simple build tool for Go which tries to

Felix Pojtinger 7 Jul 29, 2022
Build for all gccgo-supported platforms by default, disable those which you don't want (bagop with CGo support).

bagccgop Build for all gccgo-supported platforms by default, disable those which you don't want (bagop with CGo support). Overview bagccgop is a simpl

Felix Pojtinger 2 Nov 9, 2022
Flock is a project which provides a Go solution for system level file locks for all platforms Golang supports.

Flock is a project which provides a Go solution for system level file locks for all platforms Golang supports.

Ken Sipe 0 Feb 8, 2022
gopkg is a universal utility collection for Go, it complements offerings such as Boost, Better std, Cloud tools.

gopkg is a universal utility collection for Go, it complements offerings such as Boost, Better std, Cloud tools. Table of Contents Introduction

Bytedance Inc. 946 Dec 2, 2022
Lightweight selfhosted Firefox Send alternative without public upload

Gokapi Available for: Bare Metal Docker About Gokapi is a lightweight server to share files, which expire after a set amount of downloads or days. It

Marc Ole Bulling 470 Dec 4, 2022