Comments (6)
我没有遇到过这个错误。可能是你用 api.share
太频繁了。
你重新从 pan.baidu.com 获取 cookies 试试。
from baidupcs-py.
重新获取cookie,然后分享,还是 一样会出现'请重新登录'提示
更换另一个帐号之后,还是出现一样的情况
请给一个标准的api用法,因为我是看着源码调试的 很可能是 参数,我填写错误了
from baidupcs-py.
你使用的 api.share
参数没错。
请先将 BaiduPCS-Py 升级到最新版本,再用运行命令 LOG_LEVEL=DEBUG BaiduPCS-Py share /somepath
。如果出错,贴出错误信息,如果没有出错,贴出你使用 api 的代码逻辑(不需要贴cookies),方便我重现这个错误。
from baidupcs-py.
from baidupcs_py.baidupcs import BaiduPCSApi
api = BaiduPCSApi(bduss=bduss, cookies=cookies)
print(api.user_info())
# 建立记事本
with open('997.txt', "a")as f:
f.write('9999')
# 上传记事本
with open('997.txt', "rb")as f:
print(api.upload_file(f,remotepath='/997.txt'))
# 分享记事本
print(api.share("/997.txt"))
BaiduPCSError Traceback (most recent call last)
<ipython-input-11-66415abcf80d> in <module>()
8
9 # 分享记事本
---> 10 print(api.share("/997.txt"))
1 frames
/usr/local/lib/python3.7/dist-packages/baidupcs_py/baidupcs/errors.py in check(*args, **kwargs)
148
149 if err:
--> 150 raise err
151 return info
152
BaiduPCSError: error_code: -6, message: 请重新登录
from baidupcs-py.
确实存在这个问题。在使用了很长时间的 cookies 上复现了这个错误。
之后,我重新在 pan.baidu.com 登录后,获取了新的 cookies,用这个 cookies 就没有报错了。
from baidupcs-py.
非常感谢,已解决
清理cookie之后 重新登录即可
from baidupcs-py.
Related Issues (20)
- api接口无法登录 HOT 5
- 希望减少一下依赖,baidupcs-py构建太慢了 HOT 1
- 希望sdk能够给上传文件,加个进度条显示 HOT 3
- 用docker的python镜像构建,会报下面的错误 HOT 5
- 发布增加 wheel 文件
- Feature Request: extract sdk/api into a seperat package HOT 3
- Support python 3.11 HOT 1
- BaiduPCS-Py save的时候REMOTEDIR路径中有空格怎么处理 HOT 5
- 开启HTTP服务时报错 HOT 1
- 列出目录和下载凡是带空格的文件夹好像都失效了 HOT 3
- 有没有办法生成BaiduYunCacheFileV0.db 文件 HOT 1
- 上传文件到最后10%左右速度下降至200k HOT 2
- 上传速度突然变慢/8.19彻底无法上传 HOT 8
- 求教大佬们,同步本地目录到网盘的命令,如何显示进度? HOT 1
- (v0.7.6) System ERROR: Cannot specify `Depends` for type
- 如何自定义配置目录 HOT 1
- 安装时报错Failed to build BaiduPCS-Py ERROR: Could not build wheels for BaiduPCS-Py, which is required to install pyproject.toml-based projects
- 在使用share命令后出现:BaiduPCSError: error_code: 2, message: 参数错误 HOT 1
- subprocess-exited-with-error 安装baidupc-py失败 HOT 1
- 交互运行后出现cookies的字典格式不正确 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from baidupcs-py.