From 1c9b46a034f1b69d8503de12c3365137260c4d4b Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Mon, 15 May 2023 04:52:08 +0000 Subject: automatic import of python-aliyunpan --- .gitignore | 1 + python-aliyunpan.spec | 1125 +++++++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 1127 insertions(+) create mode 100644 python-aliyunpan.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..a9f9ff7 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/aliyunpan-3.0.9.tar.gz diff --git a/python-aliyunpan.spec b/python-aliyunpan.spec new file mode 100644 index 0000000..e8a171f --- /dev/null +++ b/python-aliyunpan.spec @@ -0,0 +1,1125 @@ +%global _empty_manifest_terminate_build 0 +Name: python-aliyunpan +Version: 3.0.9 +Release: 1 +Summary: aliyunpan cli +License: GNU General Public License v3 (GPLv3) +URL: https://github.com/wxy1343/aliyunpan +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/4c/ac/0f2a3c21e3bd2010b4fd6267172a9aaacbb0e9f3a397ee92626f66826a59/aliyunpan-3.0.9.tar.gz +BuildArch: noarch + + +%description +阿里云盘cli +环境要求: python 3.7 通过测试 +~~低版本环境运行报错参考~~[~~issue9~~](https://github.com/wxy1343/aliyunpan/issues/9) +## 安装 +```shell +pip install aliyunpan +``` +## 更新 +```shell +pip install aliyunpan --upgrade +``` +## 运行 +```shell +aliyunpan-cli +``` +## pyinstaller打包 +[最新版下载](https://github.com/wxy1343/aliyunpan/releases/latest) (GitHub +Actions打包,glibc版本较高 [#42](https://github.com/wxy1343/aliyunpan/issues/42)) +[第三方下载](https://media.cooluc.com/source/aliyunDrive-cli) (更新较慢) +## 克隆项目 +* `--recurse-submodules` 用于克隆子模块,部分功能需要(可选) +```shell +git clone https://github.com/wxy1343/aliyunpan --recurse-submodules +``` +## 获取refresh_token +![token](https://github.com/wxy1343/aliyunpan/raw/main/token.png) +### 注意 +* web端获取的refresh_token有防盗链检测 +1. 可以指定账号密码登入 +2. 可以通过手机端查找日志获取refresh_token +> /sdcard/Android/data/com.alicloud.databox/files/logs/trace/userId/yunpan/latest.log +* ~~登录api加入了ua检测,需要运行混淆的js代码来获取ua~~ +* ~~推荐安装 [node.js](https://nodejs.org) 和 [jsdom](https://github.com/jsdom/jsdom) 模块来运行js代码~~ +* 目前阿里云盘修改了ua的算法,加入了鼠标移动之类的信息,如果有解决方法的欢迎来[pr](https://github.com/wxy1343/aliyunpan/pulls) +```shell +npm install jsdom +``` +### 配置refresh_token +```shell +echo "refresh_token: 'xxxxx'" > ~/.config/aliyunpan.yaml +``` +### 配置账号(可选) +```shell +echo "username: 'xxxxx'" > ~/.config/aliyunpan.yaml +echo "password: 'xxxxx'" >> ~/.config/aliyunpan.yaml +``` +### 配置aria2(可选) +```shell +cat >> ~/.config/aliyunpan.yaml < + 查看详情 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
参数描述
-h, --help查看帮助
--version查看版本
-c, --config-file指定配置文件
-t, --refresh-token指定REFRESH_TOKEN
-u, --username指定账号
-p, --password指定密码
-d, --depth文件递归深度
-T, --timeout请求超时时间(秒)
-id, --drive-id指定drive_id
-a, --album是否访问相册
-s, --share-id指定分享id
-sp, --share-pwd指定分享密码
-f, --filter-file过滤文件(多个)
-w, --whitelist使用白名单过滤文件
-m, --match指定使用正则匹配文件
+ +* 查看指令参数 +```shell +aliyunpan-cli COMMAND -h +``` +
+ 查看详情 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
指令参数描述
download-p, --file选择文件(多个)
download-s, --share指定分享的序列文件
download-cs, --chunk-size分块大小(字节)
download-a, --aria2发送到aria2
ls,search-l查看详情
share-p, --file指定文件(多个)
share-f, --file-id指定file_id(多个)
share-t, --expire-sec分享过期时间(秒),默认最大14400
share-l, --share-link输出分享链接
share-d, --download-link输出下载链接
share-s, --save保存序列文件到云盘和本地
share-S, --share-official官方分享功能(需要账号支持)
upload-p, --file选择文件(多个)
upload,sync-t, --time-out分块上传超时时间(秒)
upload,sync-r, --retry上传失败重试次数
upload-f, --force强制覆盖文件
upload-s, --share指定分享的序列文件
upload,sync-cs, --chunk-size分块大小(字节)
upload-c断点续传
cat-e, --encoding文件编码
sync-st, --sync-time同步间隔时间
sync--no-delete, -n不删除(云盘/本地)文件(默认)
sync-d, --delete允许删除(云盘/本地)文件
sync-l, --local同步云盘文件到本地
token--refresh, -r刷新配置文件token
token--refresh-time, -t自动刷新token间隔时间(秒)
token--change, -c设置新的refresh_token
+
+### 断点续传 +* 将文件分成多块顺序上传 +* 文件上传进度保存在当前目录下的tasks.yaml +* 格式 + ```yaml + 文件sha1: + path: 绝对路径 + upload_id: 上传id + file_id: 文件id + chunk_size: 分块大小 + part_number: 最后上传的分块编号 + ``` +* 文件未上传成功时,CTRL+C会自动保存 +* 断点续传需带上参数-c +### 分享 +* 由于官方修改秒传接口导致该功能失效 +* 暂时采用在秒传链接中加入直链的方法用以获取proof_code +* 分享秒传文件时需要通过直链获取文件随机8字节,导致速度较慢 +* 由于直链的局限,秒传链接有效期为4小时 +1.分享链接格式 +``` +aliyunpan://文件名|sha1|url_base64|文件大小|相对路径 +``` +例如 +* 以下秒传链接均已失效,仅供参考 +``` +aliyunpan://示例文件.txt|F61851825609372B3D7F802E600B35A497CFC38E|url_base64|24|root +``` +2.文件分享 +```shell +aliyunpan-cli share 示例文件.txt +``` +导入 +```shell +aliyunpan-cli upload "aliyunpan://示例文件.txt|F61851825609372B3D7F802E600B35A497CFC38E|url_base64|24|root" +``` +3.文件夹分享 +```shell +aliyunpan-cli share 示例文件夹 +``` +导入 +```shell +aliyunpan-cli upload -s "aliyunpan://示例文件夹|80E7E25109D4246653B600FDFEDD8D8B0D97E517|url_base64|970|root" +``` +### TUI按键指南 +* 显示菜单(ctrl+x) +* 退出(ctrl+c) +* 切换标签(↑↓←→,kjhl,TAB) +### 环境变量 +```ALIYUNPAN_CONF``` 配置文件路径 +```ALIYUNPAN_ROOT``` 根目录(log和tasks输出路径) +## 致谢 +感谢 [zhjc1124/aliyundrive](https://github.com/zhjc1124/aliyundrive) 的登录接口参考 + +%package -n python3-aliyunpan +Summary: aliyunpan cli +Provides: python-aliyunpan +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-aliyunpan +阿里云盘cli +环境要求: python 3.7 通过测试 +~~低版本环境运行报错参考~~[~~issue9~~](https://github.com/wxy1343/aliyunpan/issues/9) +## 安装 +```shell +pip install aliyunpan +``` +## 更新 +```shell +pip install aliyunpan --upgrade +``` +## 运行 +```shell +aliyunpan-cli +``` +## pyinstaller打包 +[最新版下载](https://github.com/wxy1343/aliyunpan/releases/latest) (GitHub +Actions打包,glibc版本较高 [#42](https://github.com/wxy1343/aliyunpan/issues/42)) +[第三方下载](https://media.cooluc.com/source/aliyunDrive-cli) (更新较慢) +## 克隆项目 +* `--recurse-submodules` 用于克隆子模块,部分功能需要(可选) +```shell +git clone https://github.com/wxy1343/aliyunpan --recurse-submodules +``` +## 获取refresh_token +![token](https://github.com/wxy1343/aliyunpan/raw/main/token.png) +### 注意 +* web端获取的refresh_token有防盗链检测 +1. 可以指定账号密码登入 +2. 可以通过手机端查找日志获取refresh_token +> /sdcard/Android/data/com.alicloud.databox/files/logs/trace/userId/yunpan/latest.log +* ~~登录api加入了ua检测,需要运行混淆的js代码来获取ua~~ +* ~~推荐安装 [node.js](https://nodejs.org) 和 [jsdom](https://github.com/jsdom/jsdom) 模块来运行js代码~~ +* 目前阿里云盘修改了ua的算法,加入了鼠标移动之类的信息,如果有解决方法的欢迎来[pr](https://github.com/wxy1343/aliyunpan/pulls) +```shell +npm install jsdom +``` +### 配置refresh_token +```shell +echo "refresh_token: 'xxxxx'" > ~/.config/aliyunpan.yaml +``` +### 配置账号(可选) +```shell +echo "username: 'xxxxx'" > ~/.config/aliyunpan.yaml +echo "password: 'xxxxx'" >> ~/.config/aliyunpan.yaml +``` +### 配置aria2(可选) +```shell +cat >> ~/.config/aliyunpan.yaml < + 查看详情 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
参数描述
-h, --help查看帮助
--version查看版本
-c, --config-file指定配置文件
-t, --refresh-token指定REFRESH_TOKEN
-u, --username指定账号
-p, --password指定密码
-d, --depth文件递归深度
-T, --timeout请求超时时间(秒)
-id, --drive-id指定drive_id
-a, --album是否访问相册
-s, --share-id指定分享id
-sp, --share-pwd指定分享密码
-f, --filter-file过滤文件(多个)
-w, --whitelist使用白名单过滤文件
-m, --match指定使用正则匹配文件
+ +* 查看指令参数 +```shell +aliyunpan-cli COMMAND -h +``` +
+ 查看详情 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
指令参数描述
download-p, --file选择文件(多个)
download-s, --share指定分享的序列文件
download-cs, --chunk-size分块大小(字节)
download-a, --aria2发送到aria2
ls,search-l查看详情
share-p, --file指定文件(多个)
share-f, --file-id指定file_id(多个)
share-t, --expire-sec分享过期时间(秒),默认最大14400
share-l, --share-link输出分享链接
share-d, --download-link输出下载链接
share-s, --save保存序列文件到云盘和本地
share-S, --share-official官方分享功能(需要账号支持)
upload-p, --file选择文件(多个)
upload,sync-t, --time-out分块上传超时时间(秒)
upload,sync-r, --retry上传失败重试次数
upload-f, --force强制覆盖文件
upload-s, --share指定分享的序列文件
upload,sync-cs, --chunk-size分块大小(字节)
upload-c断点续传
cat-e, --encoding文件编码
sync-st, --sync-time同步间隔时间
sync--no-delete, -n不删除(云盘/本地)文件(默认)
sync-d, --delete允许删除(云盘/本地)文件
sync-l, --local同步云盘文件到本地
token--refresh, -r刷新配置文件token
token--refresh-time, -t自动刷新token间隔时间(秒)
token--change, -c设置新的refresh_token
+
+### 断点续传 +* 将文件分成多块顺序上传 +* 文件上传进度保存在当前目录下的tasks.yaml +* 格式 + ```yaml + 文件sha1: + path: 绝对路径 + upload_id: 上传id + file_id: 文件id + chunk_size: 分块大小 + part_number: 最后上传的分块编号 + ``` +* 文件未上传成功时,CTRL+C会自动保存 +* 断点续传需带上参数-c +### 分享 +* 由于官方修改秒传接口导致该功能失效 +* 暂时采用在秒传链接中加入直链的方法用以获取proof_code +* 分享秒传文件时需要通过直链获取文件随机8字节,导致速度较慢 +* 由于直链的局限,秒传链接有效期为4小时 +1.分享链接格式 +``` +aliyunpan://文件名|sha1|url_base64|文件大小|相对路径 +``` +例如 +* 以下秒传链接均已失效,仅供参考 +``` +aliyunpan://示例文件.txt|F61851825609372B3D7F802E600B35A497CFC38E|url_base64|24|root +``` +2.文件分享 +```shell +aliyunpan-cli share 示例文件.txt +``` +导入 +```shell +aliyunpan-cli upload "aliyunpan://示例文件.txt|F61851825609372B3D7F802E600B35A497CFC38E|url_base64|24|root" +``` +3.文件夹分享 +```shell +aliyunpan-cli share 示例文件夹 +``` +导入 +```shell +aliyunpan-cli upload -s "aliyunpan://示例文件夹|80E7E25109D4246653B600FDFEDD8D8B0D97E517|url_base64|970|root" +``` +### TUI按键指南 +* 显示菜单(ctrl+x) +* 退出(ctrl+c) +* 切换标签(↑↓←→,kjhl,TAB) +### 环境变量 +```ALIYUNPAN_CONF``` 配置文件路径 +```ALIYUNPAN_ROOT``` 根目录(log和tasks输出路径) +## 致谢 +感谢 [zhjc1124/aliyundrive](https://github.com/zhjc1124/aliyundrive) 的登录接口参考 + +%package help +Summary: Development documents and examples for aliyunpan +Provides: python3-aliyunpan-doc +%description help +阿里云盘cli +环境要求: python 3.7 通过测试 +~~低版本环境运行报错参考~~[~~issue9~~](https://github.com/wxy1343/aliyunpan/issues/9) +## 安装 +```shell +pip install aliyunpan +``` +## 更新 +```shell +pip install aliyunpan --upgrade +``` +## 运行 +```shell +aliyunpan-cli +``` +## pyinstaller打包 +[最新版下载](https://github.com/wxy1343/aliyunpan/releases/latest) (GitHub +Actions打包,glibc版本较高 [#42](https://github.com/wxy1343/aliyunpan/issues/42)) +[第三方下载](https://media.cooluc.com/source/aliyunDrive-cli) (更新较慢) +## 克隆项目 +* `--recurse-submodules` 用于克隆子模块,部分功能需要(可选) +```shell +git clone https://github.com/wxy1343/aliyunpan --recurse-submodules +``` +## 获取refresh_token +![token](https://github.com/wxy1343/aliyunpan/raw/main/token.png) +### 注意 +* web端获取的refresh_token有防盗链检测 +1. 可以指定账号密码登入 +2. 可以通过手机端查找日志获取refresh_token +> /sdcard/Android/data/com.alicloud.databox/files/logs/trace/userId/yunpan/latest.log +* ~~登录api加入了ua检测,需要运行混淆的js代码来获取ua~~ +* ~~推荐安装 [node.js](https://nodejs.org) 和 [jsdom](https://github.com/jsdom/jsdom) 模块来运行js代码~~ +* 目前阿里云盘修改了ua的算法,加入了鼠标移动之类的信息,如果有解决方法的欢迎来[pr](https://github.com/wxy1343/aliyunpan/pulls) +```shell +npm install jsdom +``` +### 配置refresh_token +```shell +echo "refresh_token: 'xxxxx'" > ~/.config/aliyunpan.yaml +``` +### 配置账号(可选) +```shell +echo "username: 'xxxxx'" > ~/.config/aliyunpan.yaml +echo "password: 'xxxxx'" >> ~/.config/aliyunpan.yaml +``` +### 配置aria2(可选) +```shell +cat >> ~/.config/aliyunpan.yaml < + 查看详情 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
参数描述
-h, --help查看帮助
--version查看版本
-c, --config-file指定配置文件
-t, --refresh-token指定REFRESH_TOKEN
-u, --username指定账号
-p, --password指定密码
-d, --depth文件递归深度
-T, --timeout请求超时时间(秒)
-id, --drive-id指定drive_id
-a, --album是否访问相册
-s, --share-id指定分享id
-sp, --share-pwd指定分享密码
-f, --filter-file过滤文件(多个)
-w, --whitelist使用白名单过滤文件
-m, --match指定使用正则匹配文件
+ +* 查看指令参数 +```shell +aliyunpan-cli COMMAND -h +``` +
+ 查看详情 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
指令参数描述
download-p, --file选择文件(多个)
download-s, --share指定分享的序列文件
download-cs, --chunk-size分块大小(字节)
download-a, --aria2发送到aria2
ls,search-l查看详情
share-p, --file指定文件(多个)
share-f, --file-id指定file_id(多个)
share-t, --expire-sec分享过期时间(秒),默认最大14400
share-l, --share-link输出分享链接
share-d, --download-link输出下载链接
share-s, --save保存序列文件到云盘和本地
share-S, --share-official官方分享功能(需要账号支持)
upload-p, --file选择文件(多个)
upload,sync-t, --time-out分块上传超时时间(秒)
upload,sync-r, --retry上传失败重试次数
upload-f, --force强制覆盖文件
upload-s, --share指定分享的序列文件
upload,sync-cs, --chunk-size分块大小(字节)
upload-c断点续传
cat-e, --encoding文件编码
sync-st, --sync-time同步间隔时间
sync--no-delete, -n不删除(云盘/本地)文件(默认)
sync-d, --delete允许删除(云盘/本地)文件
sync-l, --local同步云盘文件到本地
token--refresh, -r刷新配置文件token
token--refresh-time, -t自动刷新token间隔时间(秒)
token--change, -c设置新的refresh_token
+
+### 断点续传 +* 将文件分成多块顺序上传 +* 文件上传进度保存在当前目录下的tasks.yaml +* 格式 + ```yaml + 文件sha1: + path: 绝对路径 + upload_id: 上传id + file_id: 文件id + chunk_size: 分块大小 + part_number: 最后上传的分块编号 + ``` +* 文件未上传成功时,CTRL+C会自动保存 +* 断点续传需带上参数-c +### 分享 +* 由于官方修改秒传接口导致该功能失效 +* 暂时采用在秒传链接中加入直链的方法用以获取proof_code +* 分享秒传文件时需要通过直链获取文件随机8字节,导致速度较慢 +* 由于直链的局限,秒传链接有效期为4小时 +1.分享链接格式 +``` +aliyunpan://文件名|sha1|url_base64|文件大小|相对路径 +``` +例如 +* 以下秒传链接均已失效,仅供参考 +``` +aliyunpan://示例文件.txt|F61851825609372B3D7F802E600B35A497CFC38E|url_base64|24|root +``` +2.文件分享 +```shell +aliyunpan-cli share 示例文件.txt +``` +导入 +```shell +aliyunpan-cli upload "aliyunpan://示例文件.txt|F61851825609372B3D7F802E600B35A497CFC38E|url_base64|24|root" +``` +3.文件夹分享 +```shell +aliyunpan-cli share 示例文件夹 +``` +导入 +```shell +aliyunpan-cli upload -s "aliyunpan://示例文件夹|80E7E25109D4246653B600FDFEDD8D8B0D97E517|url_base64|970|root" +``` +### TUI按键指南 +* 显示菜单(ctrl+x) +* 退出(ctrl+c) +* 切换标签(↑↓←→,kjhl,TAB) +### 环境变量 +```ALIYUNPAN_CONF``` 配置文件路径 +```ALIYUNPAN_ROOT``` 根目录(log和tasks输出路径) +## 致谢 +感谢 [zhjc1124/aliyundrive](https://github.com/zhjc1124/aliyundrive) 的登录接口参考 + +%prep +%autosetup -n aliyunpan-3.0.9 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-aliyunpan -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Mon May 15 2023 Python_Bot - 3.0.9-1 +- Package Spec generated diff --git a/sources b/sources new file mode 100644 index 0000000..0261728 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +d399c8b68597feda8022dc45e29e4160 aliyunpan-3.0.9.tar.gz -- cgit v1.2.3