edit

编辑信息和删改

这个模块提供了一些和修改文件或目录信息有关的函数

p115client.tool.edit.batch_copy(client: str | PathLike | P115Client | P115OpenClient, ids: int | str | Iterable[int | str], pid: int | str = 0, batch_size: int = 1000, app: str = 'android', *, async_: Literal[False] = False, **request_kwargs) None[source]
p115client.tool.edit.batch_copy(client: str | PathLike | P115Client | P115OpenClient, ids: int | str | Iterable[int | str], pid: int | str = 0, batch_size: int = 1000, app: str = 'android', *, async_: Literal[True], **request_kwargs) Coroutine[Any, Any, None]

批量复制

Note

复制操作不支持并发

Parameters:
  • client – 115 客户端或 cookies

  • ids – 一组文件或目录的 id 或 pickcode

  • pid – 目标目录的 id 或 pickcode

  • batch_size – 批次大小,分批次,每次提交的 id 数

  • app – 使用此设备的接口

  • async – 是否异步

  • request_kwargs – 其它请求参数

p115client.tool.edit.batch_copy_files(client: str | PathLike | P115Client | P115OpenClient, top: int | str, pid: int | str = 0, flatten: bool = False, id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int]] = Ellipsis, app: str = 'web', *, async_: Literal[False] = False, **request_kwargs) dict[source]
p115client.tool.edit.batch_copy_files(client: str | PathLike | P115Client | P115OpenClient, top: int | str, pid: int | str = 0, flatten: bool = False, id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int]] = Ellipsis, app: str = 'web', *, async_: Literal[True], **request_kwargs) Coroutine[Any, Any, dict]

批量复制某个目录下的所有文件(不包括目录)

Parameters:
  • client – 115 客户端或 cookies

  • top – 顶层目录 id

  • pid – 目标目录的 id 或 pickcode

  • flatten – 如果为 True,则会把文件直接移动到 pid 之下,否则会创建次级目录

  • id_to_dirnode – 字典,保存 id 到对应文件的 (name, parent_id) 元组的字典

  • app – 使用此设备的接口

  • async – 是否异步

  • request_kwargs – 其它请求参数

Returns:

字典,key 是目标目录 id,value 是文件 id 的列表

p115client.tool.edit.batch_delete(client: str | PathLike | P115Client | P115OpenClient, ids: int | str | Iterable[int | str], batch_size: int = 1000, app: str = 'android', *, async_: Literal[False] = False, **request_kwargs) None[source]
p115client.tool.edit.batch_delete(client: str | PathLike | P115Client | P115OpenClient, ids: int | str | Iterable[int | str], batch_size: int = 1000, app: str = 'android', *, async_: Literal[True], **request_kwargs) Coroutine[Any, Any, None]

批量删除

Note

删除操作不支持并发

Parameters:
  • client – 115 客户端或 cookies

  • ids – 一组文件或目录的 id 或 pickcode

  • batch_size – 批次大小,分批次,每次提交的 id 数

  • app – 使用此设备的接口

  • async – 是否异步

  • request_kwargs – 其它请求参数

p115client.tool.edit.batch_delete_files(client: str | PathLike | P115Client | P115OpenClient, top: int | str = 0, batch_size: int = 1000, app: str = 'web', *, async_: Literal[False] = False, **request_kwargs) int[source]
p115client.tool.edit.batch_delete_files(client: str | PathLike | P115Client | P115OpenClient, top: int | str = 0, batch_size: int = 1000, app: str = 'web', *, async_: Literal[True], **request_kwargs) Coroutine[Any, Any, int]

批量删除某个目录下的所有文件(不包括目录)

Parameters:
  • client – 115 客户端或 cookies

  • top – 顶层目录 id

  • batch_size – 每批次大小

  • app – 使用此设备的接口

  • async – 是否异步

  • request_kwargs – 其它请求参数

Returns:

删除的文件总数

p115client.tool.edit.batch_hide(client: str | PathLike | P115Client, ids: int | str | Iterable[int | str], hidden: bool = True, batch_size: int = 10000, app: str = 'web', *, async_: Literal[False] = False, **request_kwargs)[source]
p115client.tool.edit.batch_hide(client: str | PathLike | P115Client, ids: int | str | Iterable[int | str], hidden: bool = True, batch_size: int = 10000, app: str = 'web', *, async_: Literal[True], **request_kwargs) Coroutine

批量隐藏(加密/隐藏模式)或展示文件或目录

Parameters:
  • client – 115 客户端或 cookies

  • ids – 一组目录的 id 或 pickcode

  • hidden – 是否隐藏

  • batch_size – 批次大小,分批次,每次提交的 id 数

  • async – 是否异步

  • request_kwargs – 其它请求参数

p115client.tool.edit.batch_makedir(client: str | PathLike | P115Client | P115OpenClient, pairs: str | tuple[int, str] | Iterable[str | tuple[int | str, str]], /, pid: int | str = 0, contain_dir: bool = False, mapping: None | MutableMapping[tuple[int, str], dict] = None, max_workers: None | int = 0, app: str = 'android', *, async_: Literal[False] = False, **request_kwargs) MutableMapping[tuple[int, str], dict][source]
p115client.tool.edit.batch_makedir(client: str | PathLike | P115Client | P115OpenClient, pairs: str | tuple[int, str] | Iterable[str | tuple[int | str, str]], /, pid: int | str = 0, contain_dir: bool = False, mapping: None | MutableMapping[tuple[int, str], dict] = None, max_workers: None | int = 0, app: str = 'android', *, async_: Literal[True], **request_kwargs) Coroutine[Any, Any, MutableMapping[tuple[int, str], dict]]

批量创建目录

Parameters:
  • client – 115 客户端或 cookies

  • pairs – 一系列的 名字或相对路径 或者 (目录的 id 或 pickcode, 名字或相对路径) 的 2 元组

  • pid – 目标目录的 id 或 pickcode 或 path,如果输入的是 名字或相对路径,则创建在此目录下

  • contain_dir – 如果为 True,则要创建的是相对路径(文件存在也能正确返回),否则就是一个文件(即使其中包含 “/”,但文件存在时会报错)

  • mapping – 结果缓存,如果要创建的对象在此中,则会被跳过

  • max_workers – 并发工作数,如果为 None 或者 <= 0,则自动确定

  • app – 使用此设备的接口

  • async – 是否异步

  • request_kwargs – 其它请求参数

Returns:

迭代器,产生 (每项输入, 相应的接口响应) 的 2 元组

p115client.tool.edit.batch_move(client: str | PathLike | P115Client | P115OpenClient, ids: int | str | Iterable[int | str], pid: int | str = 0, batch_size: int = 1000, app: str = 'android', *, async_: Literal[False] = False, **request_kwargs) None[source]
p115client.tool.edit.batch_move(client: str | PathLike | P115Client | P115OpenClient, ids: int | str | Iterable[int | str], pid: int | str = 0, batch_size: int = 1000, app: str = 'android', *, async_: Literal[True], **request_kwargs) Coroutine[Any, Any, None]

批量移动

Note

移动操作不支持并发

Parameters:
  • client – 115 客户端或 cookies

  • ids – 一组文件或目录的 id 或 pickcode

  • pid – 目标目录的 id 或 pickcode

  • batch_size – 批次大小,分批次,每次提交的 id 数

  • app – 使用此设备的接口

  • async – 是否异步

  • request_kwargs – 其它请求参数

p115client.tool.edit.batch_move_files(client: str | PathLike | P115Client | P115OpenClient, top: int | str, pid: int | str = 0, flatten: bool = False, id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int]] = Ellipsis, app: str = 'web', *, async_: Literal[False] = False, **request_kwargs) dict[source]
p115client.tool.edit.batch_move_files(client: str | PathLike | P115Client | P115OpenClient, top: int | str, pid: int | str = 0, flatten: bool = False, id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int]] = Ellipsis, app: str = 'web', *, async_: Literal[True], **request_kwargs) Coroutine[Any, Any, dict]

批量移动某个目录下的所有文件(不包括目录)

Parameters:
  • client – 115 客户端或 cookies

  • top – 顶层目录 id

  • pid – 目标目录的 id 或 pickcode

  • flatten – 如果为 True,则会把文件直接移动到 pid 之下,否则会创建次级目录

  • id_to_dirnode – 字典,保存 id 到对应文件的 (name, parent_id) 元组的字典

  • app – 使用此设备的接口

  • async – 是否异步

  • request_kwargs – 其它请求参数

Returns:

字典,key 是目标目录 id,value 是文件 id 的列表

p115client.tool.edit.batch_recyclebin_clean(client: str | PathLike | P115Client | P115OpenClient, rids: int | str | Iterable[int | str], /, password: str = '000000', batch_size: int = 1000, app: str = 'android', *, async_: Literal[False] = False, **request_kwargs) None[source]
p115client.tool.edit.batch_recyclebin_clean(client: str | PathLike | P115Client | P115OpenClient, rids: int | str | Iterable[int | str], /, password: str = '000000', batch_size: int = 1000, app: str = 'android', *, async_: Literal[True], **request_kwargs) Coroutine[Any, Any, None]

批量永久删除(从回收站)

Note

可以在设置中的【账号安全/安全密钥】页面下,关闭【文件(隐藏模式/清空删除回收站)】的按钮,就不需要传安全密钥了

Parameters:
  • client – 115 客户端或 cookies

  • rids – 文件或目录在回收站中的 id,如果不传,就是清空

  • password – 安全密钥,是 6 位数字

  • batch_size – 批次大小,分批次,每次提交的 id 数

  • app – 使用此设备的接口

  • async – 是否异步

  • request_kwargs – 其它请求参数

p115client.tool.edit.batch_recyclebin_revert(client: str | PathLike | P115Client | P115OpenClient, rids: int | str | Iterable[int | str], /, batch_size: int = 1000, app: str = 'android', *, async_: Literal[False] = False, **request_kwargs) None[source]
p115client.tool.edit.batch_recyclebin_revert(client: str | PathLike | P115Client | P115OpenClient, rids: int | str | Iterable[int | str], /, batch_size: int = 1000, app: str = 'android', *, async_: Literal[True], **request_kwargs) Coroutine[Any, Any, None]

批量还原(从回收站)

Note

还原操作不支持并发

Parameters:
  • client – 115 客户端或 cookies

  • rids – 文件或目录在回收站中的 id

  • batch_size – 批次大小,分批次,每次提交的 id 数

  • app – 使用此设备的接口

  • async – 是否异步

  • request_kwargs – 其它请求参数

p115client.tool.edit.batch_unstar(client: str | PathLike | P115Client | P115OpenClient, /, batch_size: int = 0, ensure_file: None | bool = None, max_workers: None | int = 0, app: str = 'web', *, async_: Literal[False] = False, **request_kwargs)[source]
p115client.tool.edit.batch_unstar(client: str | PathLike | P115Client | P115OpenClient, /, batch_size: int = 0, ensure_file: None | bool = None, max_workers: None | int = 0, app: str = 'web', *, async_: Literal[True], **request_kwargs) Coroutine

批量对一批文件或目录取消星标

Parameters:
  • client – 115 客户端或 cookies

  • batch_size – 批次大小,分批次,每次提交的 id 数

  • ensure_file

    是否确保为文件

    • True: 必须是文件

    • False: 必须是目录

    • None: 可以是目录或文件

  • max_workers – 并发工作数,如果为 None 或者 <= 0,则自动确定

  • app – 使用此设备的接口

  • async – 是否异步

  • request_kwargs – 其它请求参数

p115client.tool.edit.copyfile(client: str | PathLike | P115Client | P115OpenClient, id: int | str | Mapping, /, name: str = '', pid: None | int | str = None, app: str = 'web', *, async_: Literal[False] = False, **request_kwargs) dict[source]
p115client.tool.edit.copyfile(client: str | PathLike | P115Client | P115OpenClient, id: int | str | Mapping, /, name: str = '', pid: None | int | str = None, app: str = 'web', *, async_: Literal[True], **request_kwargs) Coroutine[Any, Any, dict]

复制文件到目标目录下

Note

如果复制后的文件名相同,则使用复制接口,否则使用上传接口

Parameters:
  • client – 115 客户端或 cookies

  • id – 文件的 id、pickcode 或信息字典

  • name – 复制后的新名字,如果为空则名字相同

  • pid – 目录的 id 或 pickcode,如果为 None,则在同一目录下

  • app – 使用指定 app(设备)的接口

  • async – 是否异步

  • request_kwargs – 其它请求参数

Returns:

接口响应信息

p115client.tool.edit.iter_batch_makedir(client: str | PathLike | P115Client | P115OpenClient, pairs: Iterable[str | tuple[int | str, str]], /, pid: int | str = 0, contain_dir: bool = False, mapping: None | MutableMapping[tuple[int, str], dict] = None, max_workers: None | int = 0, app: str = 'android', *, async_: Literal[False] = False, **request_kwargs) Iterator[tuple[tuple[int, str], dict]][source]
p115client.tool.edit.iter_batch_makedir(client: str | PathLike | P115Client | P115OpenClient, pairs: Iterable[str | tuple[int | str, str]], /, pid: int | str = 0, contain_dir: bool = False, mapping: None | MutableMapping[tuple[int, str], dict] = None, max_workers: None | int = 0, app: str = 'android', *, async_: Literal[True], **request_kwargs) AsyncIterator[tuple[tuple[int, str], dict]]

批量创建目录

Parameters:
  • client – 115 客户端或 cookies

  • pairs – 一系列的 名字或相对路径 或者 (目录的 id 或 pickcode, 名字或相对路径) 的 2 元组

  • pid – 目录的 id 或 pickcode,如果输入的是 名字或相对路径,则创建在此目录下

  • contain_dir – 如果为 True,则要创建的是相对路径(文件存在也能正确返回),否则就是一个文件(即使其中包含 “/”,但文件存在时会报错)

  • mapping – 结果缓存,如果要创建的对象在此中,则会被跳过

  • max_workers – 并发工作数,如果为 None 或者 <= 0,则自动确定

  • app – 使用此设备的接口

  • async – 是否异步

  • request_kwargs – 其它请求参数

Returns:

迭代器,产生 (每项输入, 相应的接口响应) 的 2 元组

p115client.tool.edit.makedir(client: str | PathLike | P115Client | P115OpenClient, name: str, /, pid: int | str = 0, contain_dir: bool = False, app: str = 'android', *, async_: Literal[False] = False, **request_kwargs) int[source]
p115client.tool.edit.makedir(client: str | PathLike | P115Client | P115OpenClient, name: str, /, pid: int | str = 0, contain_dir: bool = False, app: str = 'android', *, async_: Literal[True], **request_kwargs) Coroutine[Any, Any, int]

创建目录

Parameters:
  • client – 115 客户端或 cookies

  • name – 名称 或 路径(如果 contain_dir 为 True)

  • pid – 目录的 id 或 pickcode,如果输入的是 名字或相对路径,则创建在此目录下

  • contain_dir – 如果为 True,则要创建的是相对路径(文件存在也能正确返回),否则就是一个文件(即使其中包含 “/”,但文件存在时会报错)

  • app – 使用此设备的接口

  • async – 是否异步

  • request_kwargs – 其它请求参数

Returns:

目录 id

p115client.tool.edit.post_event(client: str | PathLike | P115Client, ids: Iterable[int | str], /, type: Literal['doc', 'img'] = 'doc', batch_size: int = 1000, max_workers: None | int = 0, app: str = 'android', *, async_: Literal[False] = False, **request_kwargs) None[source]
p115client.tool.edit.post_event(client: str | PathLike | P115Client, ids: Iterable[int | str] | AsyncIterable[int | str], /, type: Literal['doc', 'img'] = 'doc', batch_size: int = 1000, max_workers: None | int = 0, app: str = 'android', *, async_: Literal[True], **request_kwargs) Coroutine

批量将文件或目录推送事件

Todo

是否能批量推送 “browse_audio” 或 “browse_video” 事件?

Parameters:
  • client – 115 客户端或 cookies

  • ids – 一组文件或目录的 id 或 pickcode

  • type

    事件类型

    • ”doc”: 推送 “browse_document” 事件

    • ”img”: 推送 “browse_image” 事件

  • batch_size – 批次大小,分批次,每次提交的 id 数

  • max_workers – 并发工作数,如果为 None 或者 <= 0,则自动确定

  • app – 使用此设备的接口

  • async – 是否异步

  • request_kwargs – 其它请求参数

p115client.tool.edit.renamefile(client: str | PathLike | P115Client | P115OpenClient, id: int | str | Mapping, /, name: str = '', pid: None | int | str = None, app: str = 'web', *, async_: Literal[False] = False, **request_kwargs) dict[source]
p115client.tool.edit.renamefile(client: str | PathLike | P115Client | P115OpenClient, id: int | str | Mapping, /, name: str = '', pid: None | int | str = None, app: str = 'web', *, async_: Literal[True], **request_kwargs) Coroutine[Any, Any, dict]

移动文件到目标目录下

Note

如果移动后的文件名相同或扩展名相同,则使用移动接口,否则使用上传接口

Parameters:
  • client – 115 客户端或 cookies

  • id – 文件的 id、pickcode 或信息字典

  • name – 移动后的新名字,如果为空则名字相同

  • pid – 目录的 id 或 pickcode,如果为 None,则不进行移动

  • app – 使用指定 app(设备)的接口

  • async – 是否异步

  • request_kwargs – 其它请求参数

Returns:

接口响应信息

p115client.tool.edit.transferfile(client_from: str | PathLike | P115Client | P115OpenClient, client_to: str | PathLike | P115Client | P115OpenClient, id: int | str | Mapping, /, name: str = '', pid: int | str = 0, app: str = 'web', *, async_: Literal[False] = False, **request_kwargs) dict[source]
p115client.tool.edit.transferfile(client_from: str | PathLike | P115Client | P115OpenClient, client_to: str | PathLike | P115Client | P115OpenClient, id: int | str | Mapping, /, name: str = '', pid: int | str = 0, app: str = 'web', *, async_: Literal[True], **request_kwargs) Coroutine[Any, Any, dict]

从一个 115 网盘,转移文件到另一个 115 网盘

Parameters:
  • client_from – 115 客户端或 cookies,文件来自这个网盘

  • client_to – 115 客户端或 cookies,文件去往这个网盘

  • id – 文件的 id、pickcode 或信息字典,关联在 client_from

  • name – 复制后的新名字,如果为空则名字相同,关联在 client_to

  • pid – 目录的 id 或 pickcode,,关联在 client_to

  • app – 使用指定 app(设备)的接口

  • async – 是否异步

  • request_kwargs – 其它请求参数

Returns:

接口响应信息

p115client.tool.edit.update_abstract(client: str | PathLike | P115Client, ids: Iterable[int | str], /, method: str, value: Any, batch_size: int = 10000, max_workers: None | int = 0, *, async_: Literal[False] = False, **request_kwargs)[source]
p115client.tool.edit.update_abstract(client: str | PathLike | P115Client, ids: Iterable[int | str] | AsyncIterable[int | str], /, method: str, value: Any, batch_size: int = 10000, max_workers: None | int = 0, *, async_: Literal[True], **request_kwargs) Coroutine

批量设置文件或目录

Parameters:
  • client – 115 客户端或 cookies

  • ids – 一组文件或目录的 id 或 pickcode

  • method – 方法名

  • value – 要设置的值

  • batch_size – 批次大小,分批次,每次提交的 id 数

  • max_workers – 并发工作数,如果为 None 或者 <= 0,则自动确定

  • async – 是否异步

  • request_kwargs – 其它请求参数

p115client.tool.edit.update_category_shortcut(client: str | PathLike | P115Client, ids: Iterable[int | str], /, set: bool = True, batch_size: int = 10000, max_workers: None | int = 0, *, async_: Literal[False] = False, **request_kwargs)[source]
p115client.tool.edit.update_category_shortcut(client: str | PathLike | P115Client, ids: Iterable[int | str] | AsyncIterable[int | str], /, set: bool = True, batch_size: int = 10000, max_workers: None | int = 0, *, async_: Literal[True], **request_kwargs) Coroutine

批量给目录设置显示时长

Parameters:
  • client – 115 客户端或 cookies

  • ids – 一组目录的 id 或 pickcode

  • set – 是否设为快捷入口

  • batch_size – 批次大小,分批次,每次提交的 id 数

  • max_workers – 并发工作数,如果为 None 或者 <= 0,则自动确定

  • async – 是否异步

  • request_kwargs – 其它请求参数

p115client.tool.edit.update_desc(client: str | PathLike | P115Client, ids: Iterable[int | str], /, desc: str = '', batch_size: int = 10000, max_workers: None | int = 0, app: str = 'web', *, async_: Literal[False] = False, **request_kwargs)[source]
p115client.tool.edit.update_desc(client: str | PathLike | P115Client, ids: Iterable[int | str] | AsyncIterable[int | str], /, desc: str = '', batch_size: int = 10000, max_workers: None | int = 0, app: str = 'web', *, async_: Literal[True], **request_kwargs) Coroutine

批量给文件或目录设置备注,此举可更新此文件或目录的 mtime

Parameters:
  • client – 115 客户端或 cookies

  • ids – 一组文件或目录的 id 或 pickcode

  • desc – 备注文本

  • batch_size – 批次大小,分批次,每次提交的 id 数

  • max_workers – 并发工作数,如果为 None 或者 <= 0,则自动确定

  • app – 使用此设备的接口

  • async – 是否异步

  • request_kwargs – 其它请求参数

p115client.tool.edit.update_label(client: str | PathLike | P115Client, ids: Iterable[int | str], /, label: int | str = 1, batch_size: int = 10000, max_workers: None | int = 0, app: str = 'web', *, async_: Literal[False] = False, **request_kwargs)[source]
p115client.tool.edit.update_label(client: str | PathLike | P115Client, ids: Iterable[int | str] | AsyncIterable[int | str], /, label: int | str = 1, batch_size: int = 10000, max_workers: None | int = 0, app: str = 'web', *, async_: Literal[True], **request_kwargs) Coroutine

批量给文件或目录设置标签

Parameters:
  • client – 115 客户端或 cookies

  • ids – 一组文件或目录的 id 或 pickcode

  • label – 标签 id,多个用逗号 “,” 隔开,如果用一个根本不存在的 id,效果就是清空标签列表

  • batch_size – 批次大小,分批次,每次提交的 id 数

  • max_workers – 并发工作数,如果为 None 或者 <= 0,则自动确定

  • app – 使用此设备的接口

  • async – 是否异步

  • request_kwargs – 其它请求参数

p115client.tool.edit.update_name(client: str | PathLike | P115Client, id_name_pairs: Iterable[tuple[int | str, str]], /, batch_size: int = 10000, app: str = 'web', *, async_: Literal[False] = False, **request_kwargs) dict[source]
p115client.tool.edit.update_name(client: str | PathLike | P115Client, id_name_pairs: Iterable[tuple[int | str, str]], /, batch_size: int = 10000, app: str = 'web', *, async_: Literal[True], **request_kwargs) Coroutine[Any, Any, dict]

批量给文件或目录设置名字

Note

不支持 open,是因为它仅能一次修改一个名字,并不能批量

Parameters:
  • client – 115 客户端或 cookies

  • id_name_pairs – 一堆文件或目录的 id 到新名字的元组

  • batch_size – 批次大小,分批次,每次提交的任务数

  • app – 使用此设备的接口

  • async – 是否异步

  • request_kwargs – 其它请求参数

Returns:

成功命名的 {id: name} 的字典

p115client.tool.edit.update_score(client: str | PathLike | P115Client, ids: Iterable[int | str], /, score: int = 0, batch_size: int = 10000, max_workers: None | int = 0, *, async_: Literal[False] = False, **request_kwargs)[source]
p115client.tool.edit.update_score(client: str | PathLike | P115Client, ids: Iterable[int | str] | AsyncIterable[int | str], /, score: int = 0, batch_size: int = 10000, max_workers: None | int = 0, *, async_: Literal[True], **request_kwargs) Coroutine

批量给文件或目录设置分数

Parameters:
  • client – 115 客户端或 cookies

  • ids – 一组文件或目录的 id 或 pickcode

  • score – 分数

  • batch_size – 批次大小,分批次,每次提交的 id 数

  • max_workers – 并发工作数,如果为 None 或者 <= 0,则自动确定

  • async – 是否异步

  • request_kwargs – 其它请求参数

p115client.tool.edit.update_show_play_long(client: str | PathLike | P115Client, ids: Iterable[int | str], /, show: bool = True, batch_size: int = 10000, max_workers: None | int = 0, app: str = 'web', *, async_: Literal[False] = False, **request_kwargs)[source]
p115client.tool.edit.update_show_play_long(client: str | PathLike | P115Client, ids: Iterable[int | str] | AsyncIterable[int | str], /, show: bool = True, batch_size: int = 10000, max_workers: None | int = 0, app: str = 'web', *, async_: Literal[True], **request_kwargs) Coroutine

批量给目录设置显示时长

Parameters:
  • client – 115 客户端或 cookies

  • ids – 一组目录的 id 或 pickcode

  • show – 是否显示时长

  • batch_size – 批次大小,分批次,每次提交的 id 数

  • max_workers – 并发工作数,如果为 None 或者 <= 0,则自动确定

  • app – 使用此设备的接口

  • async – 是否异步

  • request_kwargs – 其它请求参数

p115client.tool.edit.update_star(client: str | PathLike | P115Client | P115OpenClient, ids: Iterable[int | str], /, star: bool = True, batch_size: int = 10000, max_workers: None | int = 0, app: str = 'web', *, async_: Literal[False] = False, **request_kwargs)[source]
p115client.tool.edit.update_star(client: str | PathLike | P115Client | P115OpenClient, ids: Iterable[int | str] | AsyncIterable[int | str], /, star: bool = True, batch_size: int = 10000, max_workers: None | int = 0, app: str = 'web', *, async_: Literal[True], **request_kwargs) Coroutine

批量给文件或目录设置星标

Note

如果一批中有任何一个 id 已经被删除,则这一批直接失败报错

Parameters:
  • client – 115 客户端或 cookies

  • ids – 一组文件或目录的 id 或 pickcode

  • star – 是否设置星标

  • batch_size – 批次大小,分批次,每次提交的 id 数

  • max_workers – 并发工作数,如果为 None 或者 <= 0,则自动确定

  • app – 使用此设备的接口

  • async – 是否异步

  • request_kwargs – 其它请求参数

p115client.tool.edit.update_top(client: str | PathLike | P115Client, ids: Iterable[int | str], /, top: bool = True, batch_size: int = 10000, max_workers: None | int = 0, *, async_: Literal[False] = False, **request_kwargs)[source]
p115client.tool.edit.update_top(client: str | PathLike | P115Client, ids: Iterable[int | str] | AsyncIterable[int | str], /, top: bool = True, batch_size: int = 10000, max_workers: None | int = 0, *, async_: Literal[True], **request_kwargs) Coroutine

批量给文件或目录设置置顶

Parameters:
  • client – 115 客户端或 cookies

  • ids – 一组文件或目录的 id 或 pickcode

  • score – 分数

  • batch_size – 批次大小,分批次,每次提交的 id 数

  • max_workers – 并发工作数,如果为 None 或者 <= 0,则自动确定

  • async – 是否异步

  • request_kwargs – 其它请求参数