Skip to content

gene9831/one-uploader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Onedrive 上传文件命令行工具

安装

  1. 安装 python3

  2. 安装依赖

    git clone https://github.com/gene9831/one-uploader.git
    cd one-uploader
    # 需要虚拟环境请自行创建
    pip install -r requirements.txt

使用

Step1

编辑.env文件,填入以下信息。获取 app_idapp_secret 的具体步骤可参考这里

# .env
APP_ID=your_app_id
APP_SECRET=you_app_secret
REDIRECT_URL=http://localhost:5000/callback

Step2

添加用户,输入以下命令,按步骤操作即可

python account.py -a

其他用户操作使用 -h--help 参数获取帮助

Step3

上传文件,暂时只支持单个文件

# 上传文件帮助信息
$ python upload.py -h
usage: upload.py [-h] -f FILE -o ONE_DIR [-u USER]

Onedrive file upload tool

optional arguments:
  -h, --help            show this help message and exit
  -f FILE, --file FILE  file to be uploaded
  -o ONE_DIR, --one_dir ONE_DIR
                        upload to this directory
  -u USER, --user USER  specify Onedrive user, default the first one

例如

$ python upload.py -f /local/file -o /Onedrive/directory -u username@mail.com
 filename  |  size   |   per   |  speed  |   eta
-----------+---------+---------+---------+---------
 file      |  100.0M |   99.9% |  8.8M/s |  23m59s

使用 nohup& 可在后台运行

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages