Giter Club home page Giter Club logo

Comments (6)

PeterDing avatar PeterDing commented on May 28, 2024

我没有遇到过这个错误。可能是你用 api.share 太频繁了。

你重新从 pan.baidu.com 获取 cookies 试试。

from baidupcs-py.

aadd445aadda avatar aadd445aadda commented on May 28, 2024

重新获取cookie,然后分享,还是 一样会出现'请重新登录'提示
更换另一个帐号之后,还是出现一样的情况
请给一个标准的api用法,因为我是看着源码调试的 很可能是 参数,我填写错误了

from baidupcs-py.

PeterDing avatar PeterDing commented on May 28, 2024

你使用的 api.share 参数没错。

请先将 BaiduPCS-Py 升级到最新版本,再用运行命令 LOG_LEVEL=DEBUG BaiduPCS-Py share /somepath。如果出错,贴出错误信息,如果没有出错,贴出你使用 api 的代码逻辑(不需要贴cookies),方便我重现这个错误。

from baidupcs-py.

aadd445aadda avatar aadd445aadda commented on May 28, 2024
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.

PeterDing avatar PeterDing commented on May 28, 2024

确实存在这个问题。在使用了很长时间的 cookies 上复现了这个错误。

之后,我重新在 pan.baidu.com 登录后,获取了新的 cookies,用这个 cookies 就没有报错了。

from baidupcs-py.

aadd445aadda avatar aadd445aadda commented on May 28, 2024

非常感谢,已解决
清理cookie之后 重新登录即可

from baidupcs-py.

Related Issues (20)

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.