xdedss / dist_bhpan Goto Github PK
View Code? Open in Web Editor NEW北航网盘命令行工具
License: MIT License
北航网盘命令行工具
License: MIT License
本项目提供了上传、下载、管理北航网盘文件的命令行工具,适合在无GUI的服务器上使用 # Anyshare API 参考 https://developers.aishutech.com/openDoc/product/2/version/3/doc/15 # 安装 python setup.py install # 第一次运行会提示登录 # 凭据存储路径 windows: AppData/Roaming/bhpan linux: ~/.local/share/bhpan # 存储的是用北航网盘提供的公钥加密的密码,如果不想存储登录凭据,每次手动输入,那么请在凭据存储路径下的config.json中把"store_password"改为false # ls bhpan ls [远程文件/文件夹] #(可用home表示文档根目录) bhpan ls home -h # upload bhpan upload [本地文件/文件夹] [远程文件夹] # download bhpan download [远程文件/文件夹] [本地文件夹] # rm bhpan rm [远程文件/文件夹] # cat bhpan cat [远程文件] # 可pipe bhpan cat home/xxx.txt | tail # mv rm 和linux下类似 # 重命名 bhpan mv home/test.png home/test2.png # 移动(home/dir2/dir3必须存在) bhpan mv home/dir1/test.png home/dir2/dir3 # 移动并重命名 bhpan mv home/dir1/test.png home/dir2/dir3/test2.png # -f 覆盖 # mkdir可直接创建多级路径 bhpan mkdir home/test/1/2/3 # link 外链分享 # 查看文件上的外链 bhpan link show [远程文件/文件夹] # 开启/修改 # 启用密码 -p # 允许上传 --allow-upload # 禁止预览 --no-download # --expires [过期天数] bhpan link create [远程文件/文件夹] # 停止分享 bhpan link delete [远程文件/文件夹]
安装完成后,运行bhpan test,错误如下:
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='bhpan.buaa.edu.cn', port=443): Max retries exceeded with url: /api/v1/auth1/getnew (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)')))
更新以后可以正常安装并登陆,但以后输入bhpan ls home
会出现如下报错:
Traceback (most recent call last):
File "/mnt/d/miniconda3/bin/bhpan", line 33, in <module>
sys.exit(load_entry_point('bhpan==0.0.2', 'console_scripts', 'bhpan')())
File "/mnt/d/miniconda3/lib/python3.10/site-packages/bhpan-0.0.2-py3.10.egg/pancli/pancli.py", line 650, in main
File "/mnt/d/miniconda3/lib/python3.10/site-packages/bhpan-0.0.2-py3.10.egg/pancli/pancli.py", line 560, in <lambda>
File "/mnt/d/miniconda3/lib/python3.10/site-packages/bhpan-0.0.2-py3.10.egg/pancli/pancli.py", line 228, in list_dir
File "/mnt/d/miniconda3/lib/python3.10/site-packages/bhpan-0.0.2-py3.10.egg/pancli/utils/api_manager.py", line 137, in get_resource_info_by_path
File "/mnt/d/miniconda3/lib/python3.10/site-packages/bhpan-0.0.2-py3.10.egg/pancli/utils/api.py", line 93, in post_json
pancli.utils.api.ApiException: api returned HTTP 404
{"errcode":404024,"errmsg":"路径不存在","causemsg":""}
pancli.utils.api.ApiException: api returned HTTP 400
{"causemsg":"参数 (path) 的值无效(错误提供者:EFSHttpServer,
错误值:16777222,错误位置:ncEFSDirHandlerV1.cpp:344)","errcode":400002,"errmsg":"参数不合法。"}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.