Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在使用share命令后出现:BaiduPCSError: error_code: 2, message: 参数错误 #124

Open
yulongwanxue opened this issue Mar 14, 2024 · 2 comments

Comments

@yulongwanxue
Copy link

WARNNING: Please to search the similar bugs, before you report a bug. Don't report a similar bug which existed.
注意:在你提交一份报告前,请先搜索是否存在类似的报告。请勿重复提交内容相同的报告。

背景:已经检查时最新版本和最新cookies了

Describe the bug / 描述 bug
在使用share命令后出现:BaiduPCSError: error_code: 2, message: 参数错误

To Reproduce / 复现问题

  1. from baidupcs_py.baidupcs.api import BaiduPCSApi
  2. baiduapi = BaiduPCSApi(bduss=bduss, stoken=stoken, cookies=cookies)
  3. baiduapi.share('/database',password='1234',period=2)

Screenshots / 问题截图
BaiduPCSError Traceback (most recent call last)
Cell In[58], line 1
----> 1 share_link = baiduapi.share('/database',password='1234',period=2)

File d:\App\anaconda\envs\baidu\lib\site-packages\baidupcs_py\baidupcs\api.py:322, in BaiduPCSApi.share(self, password, period, *remotepaths)
314 def share(self, *remotepaths: str, password: str, period: int = 0) -> PcsSharedLink:
315 """Share remotepaths to public with a optional password
316
317 To use api, STOKEN must be in cookies
318
319 period (int): The days for expiring. 0 means no expiring
320 """
--> 322 info = self.baidupcs.share(*remotepaths, password=password, period=period)
323 link = PcsSharedLink.from
(info)._replace(paths=list(remotepaths), password=password)
324 return link

File d:\App\anaconda\envs\baidu\lib\site-packages\baidupcs_py\baidupcs\errors.py:152, in assert_ok..check(*args, **kwargs)
149 err = parse_errno(error_code)
151 if err:
--> 152 raise err
153 return info

BaiduPCSError: error_code: 2, message: 参数错误

Envrionment / 运行环境

  • OS: Windows
  • Python Python3.8
  • BaiduPCS-Py Version 0.7.6

还请大佬帮忙看下什么问题。

@PeterDing PeterDing added bug Something isn't working and removed bug Something isn't working labels Mar 16, 2024
@PeterDing
Copy link
Owner

我测试BaiduPCSApi.share没有错误。
你试试分享其他文件试试。如果还是不行,就在浏览器中分享试试。看看浏览器上能不能分享。

@fengyuewuya
Copy link

同样遇到了 这个问题, 在网页上也不能分享(提示参数错误), 客户端也不行. 是不是短时间内分享次数太多了, 触发限制?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants