Skip to content

Cannot get session #2

@dumplingincd

Description

@dumplingincd

Hello, when update, called "Cannot get session".
my python is:

def upload_to_cloud189(username, password, local_path, remote_dir="000"):
    """
    通过天翼云盘SDK上传文件
    :param username: 天翼云账号(手机号)
    :param password: 账号密码
    :param local_path: 本地文件路径
    :param remote_dir: 云端目标目录(默认为根目录)
    """
    try:
        # 初始化客户端[4,7](@ref)
        client = Cloud189({
            'username': username,
            'password': password
        })
        
        logging.info(f"✔️ 登录成功 | 账号: {username}")
        
        # 执行文件上传(SDK自动处理分片和续传)[7](@ref)
        task = client.upload(
            local_path=local_path,
            remotepath=remote_dir
        )
        
        if task.get('code') == 'SUCCESS':
            file_name = os.path.basename(local_path)
            logging.info(f"🚀 上传成功 | 云端路径: {remote_dir}/{file_name}")
            return True
        else:
            raise Exception(f"上传失败: {task.get('message')}")
            
    except Exception as e:
        logging.error(f"❌ 操作异常: {str(e)}")
        return False

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