Skip to content

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

Open

Description

@NothingCooker

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

Activity

  1. Cheryhole commented on Aug 5, 2024

    @Cheryhole

    我也是创建文件夹错误,只不过是直接报错
    `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报错了)

  2. Jason-XII commented on Aug 13, 2024

    @Jason-XII

    天哪,我遇到了同样的问题,报错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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions