Coder Social home page Coder Social logo

alidrive-uploader's Introduction

阿里云盘上传工具

如有侵权,请联系我删除

禁止用于非法用途,违者后果自负

觉得不错的可以给个star~

宝塔插件

https://github.com/aoaostar/alidrive-uploader-for-baota

演示

使用方法

curl -sL https://raw.githubusercontent.com/aoaostar/alidrive-uploader/v2/install.sh | bash 
  • 重命名example.config.yamlconfig.yaml
  • 填写好config.yaml的内容

控制台快速获取代码

var d = JSON.parse(localStorage.getItem('token'));
console.log(`  drive_id: ${d.default_drive_id}\n  refresh_token: ${d.refresh_token}`);

Proxy 使用方法

由于阿里云盘限制了海外,海外机器根本无法上传
可以使用--proxy参数设置国内代理
使用nginx配置反向代理,配置参数如下

location /{
  if ($request_uri ~ /){
    add_header content-type "application/json";
    return 200 "{\"usage\":\"Host/{URL}\"}";
  }
  if ($request_uri ~ ^/(.*)){
    set $proxy_url $1;
  }
  proxy_pass $proxy_url;
  resolver 8.8.8.8;
}

使用示例

alidrive -p(--proxy) http://proxy.aoaostar.com

或者配置文件内配置

config.yaml

debug: false
transfers: 3
proxy:
match_pattern:
retry: 3
ali_drive:
  drive_id: xxxxxxx
  refresh_token: xxxxxx
  root_path: 网盘目录

运行

Usage:
  alidrive [OPTIONS] LocalPath RemotePath

Application Options:
  -d, --debug          Debug模式
  -t, --transfers=     同时上传文件个数
  -c, --config=        配置文件路径 (default: config.yaml)
  -p, --proxy=         API代理
  -m, --match_pattern= 正则过滤
  -v, --version        输出版本信息
  -r, --retry=         请求超时最大重试次数
      --refresh        刷新token
      --clean          清空缓存,清理上传记录
      --drive_id=      驱动id
      --refresh_token= 刷新令牌
      --root_path=     根目录路径

Help Options:
  -h, --help           Show this help message

Arguments:
  LocalPath:           本地文件路径
  RemotePath:          远程文件路径

编译

由于windows命令行风格太坑,需要禁用posix style
linux正常编译即可

# linux
go build main.go
# windows
go build -tags forceposix main.go

alidrive-uploader's People

Contributors

aoaostar avatar timqi avatar ccp-p avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.