{"id":13548689,"url":"https://github.com/gaowanliang/LightUploader","last_synced_at":"2025-04-02T21:32:07.704Z","repository":{"id":53139618,"uuid":"351805113","full_name":"gaowanliang/LightUploader","owner":"gaowanliang","description":"A lightweight, universal cloud drive upload tool for all platforms","archived":false,"fork":false,"pushed_at":"2022-11-12T08:58:25.000Z","size":3388,"stargazers_count":276,"open_issues_count":11,"forks_count":84,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-03T17:40:13.672Z","etag":null,"topics":["downloadbot","googledrive","onedrive","telegram","upload"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gaowanliang.png","metadata":{"files":{"readme":"Readme-zh-CN.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-26T14:14:47.000Z","updated_at":"2024-10-24T06:46:43.000Z","dependencies_parsed_at":"2022-08-29T17:42:23.338Z","dependency_job_id":null,"html_url":"https://github.com/gaowanliang/LightUploader","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaowanliang%2FLightUploader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaowanliang%2FLightUploader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaowanliang%2FLightUploader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaowanliang%2FLightUploader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gaowanliang","download_url":"https://codeload.github.com/gaowanliang/LightUploader/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246895874,"owners_count":20851344,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["downloadbot","googledrive","onedrive","telegram","upload"],"created_at":"2024-08-01T12:01:13.246Z","updated_at":"2025-04-02T21:32:06.167Z","avatar_url":"https://github.com/gaowanliang.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# LightUploader\n\n萌咖大佬写了一个 [非常好的版本](https://github.com/MoeClub/OneList/tree/master/OneDriveUploader) ，可惜并没有开源，而且已经好久都没有更新了。这个项目作为从 [DownloadBot](https://github.com/gaowanliang/DownloadBot) 中独立出来的一个简易上传工具，旨在用更轻量化的方式让在各种平台都能快速的向各个网络硬盘上传数据。\n\n- 支持 OneDrive 国际版, 个人版(家庭版)，世纪互联，Google Drive.\n- 支持上传文件和文件夹到指定目录,并保持上传前的目录结构.\n- 支持命令参数使用, 方便外部程序调用.\n- 支持自定义上传分块大小.\n- 支持多线程上传(多文件同时上传).\n- 支持根据文件大小动态调整重试次数.\n- 支持跳过网盘中已存在的同名文件.\n- 支持通过Telegram Bot实时监控上传进度，方便使用全自动下载脚本时对上传的实时监控\n\n## 授权\n详见[wiki](https://github.com/gaowanliang/LightUploader/wiki)\n\n\n### 初始化配置文件\n```bash\n# OneDrive 国际版\nLightUploader -a \"url\"\n# OneDrive 国际版，并使用中文语言包\nLightUploader -a \"url\" -l zh-CN\n# OneDrive 个人版(家庭版)\nLightUploader -a \"url\" -v 1\n# OneDrive 中国版(世纪互联)，并使用中文语言包\nLightUploader -a \"url\" -v 2 -l zh-CN\n\n# 在浏览器地址栏中获取以 http://loaclhost 开头的整个url内容\n# 将获取的完整url内容替换命令中的 url 三个字母\n# 每次产生的 url 只能用一次, 重试请重新获取 url\n# 此操作将会自动初始化的配置文件\n\n# Google Drive\nLightUploader -v 3\n```\n\n## 使用\n```c\nUsage of LightUploader:\n  -a string\n        // 初始化授权\n        Setup and Init auth.json.\n  -b string\n        // 自定义上传分块大小, 可以提高网络吞吐量, 受限于磁盘性能和网络速度.\n  -c string\n        // 配置文件路径\n\n  -r string\n        // 上传到网盘中的某个目录, 默认: 根目录\n  -l string\n        // 软件语言\n  -f string\n        // *必要参数, 要上传的文件或文件夹\n  -t string\n        // 线程数, 同时上传文件的个数. 默认: 3\n  -to int\n        //单个数据包超时时间，默认为60s\n  -tgbot string\n        //使用Telegram机器人实时监控上传，此处需填写机器人的access token，形如123456789:xxxxxxxxx，输入时需使用双引号包裹。当写入内容为“1”时，使用配置文件中的BotKey和UserID作为载入项\n  -uid string\n        // 使用Telegram机器人实时监控上传，此处需填写接收人的userID，形如123456789\n  -m int\n        // 选择模式，0为替换网盘中同名文件，1为跳过，默认为0\n  -v int\n        // 选择版本，其中0为 OneDrive 国际版，1为 OneDrive 个人版(家庭版)，2为 OneDrive 世纪互联，3为Google Drive，默认为0\n```\n\n## 配置\n```jsonc\n{\n    // 网盘类型\n    \"Drive\":\"OneDrive\",\n    // 授权令牌\n    \"RefreshToken\": \"1234564567890ABCDEF\",\n    // 最大线程数.(同时上传文件的数量)\n    \"ThreadNum\": 2,\n    // 最大上传分块大小.(每次上传文件的最大分块大小,网络不好建议调低. 单位:MB)\n    \"BlockSize\": 10,\n    // 如果是中国版(世纪互联), 此项应为 true.\n    \"MainLand\": false,\n    //软件语言\n    \"Language\": \"zh-CN\",\n    //超时时间\n    \"TimeOut\": 60,\n    //Telegram Bot的key\n    \"BotKey\": \"\",\n    //Telegram 用户ID\n    \"UserID\": \"\"\n}\n```\n注意，当同时使用配置文件，并且配置文件中的参数不为默认值时，默认将使用配置文件中的参数，当在命令行中输入参数时，会使用当前在命令行中输入的参数，并改变配置文件中的参数。即命令行中的参数优先级高于配置文件中的参数，并会改变配置文件中的参数.\n\n## 示例\n```bash\n# 一些示例:\n\n# 将同目录下的 mm00.jpg 文件上传到 OneDrive 网盘根目录\nLightUploader -c xxx.json -f \"mm00.jpg\"\n\n# 将同目录下的 Download 文件夹上传到 OneDrive 网盘根目录\nLightUploader -c xxx.json -f \"Download\" \n\n# 将同目录下的 Download 文件夹上传到 OneDrive 网盘Test目录中\nLightUploader -c xxx.json -f \"Download\" -r \"Test\"\n\n# 将同目录下的 Download 文件夹上传到 OneDrive 网盘根目录中, 使用 10 线程\nLightUploader -c xxx.json -t 10 -f \"Download\" \n\n# 将同目录下的 Download 文件夹上传到 OneDrive 网盘根目录中, 使用 10 线程，并跳过同名文件\nLightUploader -c xxx.json -t 10 -f \"Download\" -m 1\n\n# 将同目录下的 Download 文件夹上传到 OneDrive 网盘根目录中, 使用 10 线程，同时设置超时时间为30秒\nLightUploader -c xxx.json -t 10 -f \"Download\" -to 30\n\n# 将同目录下的 Download 文件夹上传到 OneDrive 网盘根目录中, 使用 10 线程，同时使用 Telegram Bot 实时监控上传进度\nLightUploader -c xxx.json -t 10 -f \"Download\" -tgbot \"123456:xxxxxxxx\" -uid 123456789\n\n# 将同目录下的 Download 文件夹上传到 OneDrive 网盘根目录中, 使用 10 线程，同时使用配置文件中的 Telegram Bot 参数载入程序实时监控上传进度（前提是配置文件中含有Telegram Bot 的参数）\nLightUploader -c xxx.json -t 10 -f \"Download\" -tgbot \"1\"\n\n# 将同目录下的 Download 文件夹上传到 OneDrive 网盘根目录中, 使用 15 线程, 并设置分块大小为 20M\nLightUploader -c xxx.json -t 15 -b 20 -f \"Download\" \n\n```\n\n## 注意\n当上传未出现问题，返回0，可作为上传是否失败的凭证","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaowanliang%2FLightUploader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgaowanliang%2FLightUploader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaowanliang%2FLightUploader/lists"}