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

upload_file 上传文件错误 #102

Open
xie-dd opened this issue Oct 22, 2023 · 5 comments
Open

upload_file 上传文件错误 #102

xie-dd opened this issue Oct 22, 2023 · 5 comments

Comments

@xie-dd
Copy link

xie-dd commented Oct 22, 2023

我的代码是

from lanzou.api import LanZouCloud

lzy = LanZouCloud()
cookie = {'ylogin': '***', 'phpdisk_info': '***'}
print(lzy.login_by_cookie(cookie) == LanZouCloud.SUCCESS)
# can get True

code = lzy.upload_file(r"D:\\AAA.rar")
print(code)

能够正确登陆账户,也就是第一个print可以得到"True"
但是上传文件错误,错误代码如下:

Traceback (most recent call last):
  File "C:\Python38\lib\site-packages\requests\models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)
  File "C:\Python38\lib\json\__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "C:\Python38\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Python38\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "W:\lanzouz_updata\main.py", line 8, in <module>
    code = lzy.upload_file(r"D:\\AAA.rar")
  File "C:\Python38\lib\site-packages\lanzou\api\core.py", line 929, in upload_file
    return self._upload_small_file(file_path, folder_id, callback=callback, uploaded_handler=uploaded_handler)
  File "C:\Python38\lib\site-packages\lanzou\api\core.py", line 789, in _upload_small_file
    file_list = self.get_file_list(folder_id)
  File "C:\Python38\lib\site-packages\lanzou\api\core.py", line 370, in get_file_list
    resp = resp.json()
  File "C:\Python38\lib\site-packages\requests\models.py", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
@goyuu
Copy link

goyuu commented Nov 18, 2023

解决了吗

@aazz200174
Copy link

解决了,代码有BUG,要改代码

@Ninethnine
Copy link

解决了,代码有BUG,要改代码

怎么改?

@foragedysetour
Copy link

同问

@2005czq
Copy link

2005czq commented Nov 3, 2024

改请求地址,刚发,详见 #110

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

6 participants