upload#
上传
- p123client.tool.upload.upload_uri(client: P123Client, uri: str, parent_id: int = 0, duplicate: Literal[0, 1, 2] = 0, quoted: bool = True, *, async_: Literal[False] = False, **request_kwargs) dict[source]#
- p123client.tool.upload.upload_uri(client: P123Client, uri: str, parent_id: int = 0, duplicate: Literal[0, 1, 2] = 0, quoted: bool = True, *, async_: Literal[True], **request_kwargs) Coroutine[Any, Any, dict]
使用自定义链接进行秒传
- Parameters:
client – 123 网盘的客户端对象
uri – 链接,格式为 f”123://{name}|{size}|{md5}?{s3_key_flag}”,前面的 “123://” 和后面的 “?{s3_key_flag}” 都可省略
parent_id – 上传到此 id 对应的目录中
duplicate – 处理同名:0: 提醒/忽略 1: 保留两者 2: 替换
quoted – 说明链接已经过 quote 处理,所以使用时需要 unquote 回来
async – 是否异步
request_kwargs – 其它请求参数
- Returns:
接口响应,来自 P123Client.upload_request,当响应信息里面有 “Reuse” 的值为 “true”,说明秒传成功