linux下使用命令行工具alidrive上传文件到阿里云盘
下载 alidrive,并解压
wget https://github.com/aoaostar/alidrive-uploader/releases/download/v2.2.1/alidrive_uploader_v2.2.1_linux_amd64.tar.gz
tar -xvf alidrive_uploader_v2.2.1_linux_amd64.tar.gz
修改配置文件
- 重命名example_config.yaml为config.yaml
- 修改config.yaml
xxx@ubuntu:~/work/aliyun$ cat config.yaml
ali_drive:
drive_id: XXXX
refresh_token: XXXX
root_path: share
debug: false
retry: 3
transfers: 3
获取drive_id
和refresh_token
- 网页登录阿里云盘: https://www.aliyundrive.com/drive
- 按下F12打开控制台,转到Console/终端,用以下命令快速获取refresh_token
var data = JSON.parse(localStorage.getItem('token'));console.log(`refresh_token => ${data.refresh_token}default_drive_id => ${data.default_drive_id}`);
- 修改完成测试
将当前目录下的config.yaml上传到云盘根目录share,上传完毕就可以在网盘里看到了
./alidrive -c ./config.yaml ./config.yaml share
标签:云盘,drive,yaml,token,alidrive,linux,config
From: https://www.cnblogs.com/Amumu1/p/17837245.html