PeterDing / BaiduPCS-Py

BaiduPCS API & App 百度网盘客户端 和 API
MIT License
667 stars 108 forks source link

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

Open yulongwanxue opened 4 months ago

yulongwanxue commented 4 months ago

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 / 运行环境

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

PeterDing commented 4 months ago

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