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

上传文件夹时遇到了创建文件夹错误 #107

Open
Jerry-guo-happy opened this issue Jul 31, 2024 · 2 comments
Open

上传文件夹时遇到了创建文件夹错误 #107

Jerry-guo-happy opened this issue Jul 31, 2024 · 2 comments

Comments

@Jerry-guo-happy
Copy link

几乎没有延迟,一用upload_dir函数就返回5,请问这种情况可能是什么造成的,登录函数返回正常

@Cheryhole
Copy link

我也是创建文件夹错误,只不过是直接报错
`PS D:\Desktop\Music> py .\upload.py
Login Lanzouyun: SUCCESS
Traceback (most recent call last):
File "C:\Users\cyh\AppData\Local\Programs\Python\Python312\Lib\site-packages\requests\models.py", line 974, in json
return complexjson.loads(self.text, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\cyh\AppData\Local\Programs\Python\Python312\Lib\json_init_.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\cyh\AppData\Local\Programs\Python\Python312\Lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\cyh\AppData\Local\Programs\Python\Python312\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 "D:\Desktop\Music\upload.py", line 62, in
state_code = lz.upload_dir(MusicDirPath, -1, callback=progress_callback, failed_callback=failed_callback)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\cyh\AppData\Local\Programs\Python\Python312\Lib\site-packages\lanzou\api\core.py", line 966, in upload_dir
dir_id = self.mkdir(folder_id, dir_name, '批量上传')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\cyh\AppData\Local\Programs\Python\Python312\Lib\site-packages\lanzou\api\core.py", line 639, in mkdir
folder_list = self.get_dir_list(parent_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\cyh\AppData\Local\Programs\Python\Python312\Lib\site-packages\lanzou\api\core.py", line 396, in get_dir_list
for folder in resp.json()['text']:
^^^^^^^^^^^
File "C:\Users\cyh\AppData\Local\Programs\Python\Python312\Lib\site-packages\requests\models.py", line 978, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)`
我看了一下resp.txt和resp.context是空的(所以json报错了)

@Jason-XII
Copy link

天哪,我遇到了同样的问题,报错simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

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