history¶
115 历史记录
这个模块提供了一些和 115 的历史记录有关的函数
- p115client.tool.history.HISTORY_NAME_TO_TYPE: Final = {'all': 0, 'browse_video': 3, 'move': 8, 'offline_download': 2, 'receive': 7, 'upload': 4}¶
115 生活操作事件名称到类型的映射
- p115client.tool.history.HISTORY_TYPE_TO_NAME: Final = {0: 'all', 2: 'offline_download', 3: 'browse_video', 4: 'upload', 7: 'receive', 8: 'move'}¶
115 生活操作事件类型到名称的映射
- p115client.tool.history.iter_history(client: str | PathLike | P115Client, from_id: int = 0, from_time: float = 0, type: int | str = 0, ignore_types: None | Container[int] = None, app: str = 'web', cooldown: int | float = 0, interval: int | float = 0, *, async_: Literal[False] = False, **request_kwargs) Iterator[dict][source]¶
- p115client.tool.history.iter_history(client: str | PathLike | P115Client, from_id: int = 0, from_time: float = 0, type: int | str = 0, ignore_types: None | Container[int] = None, app: str = 'web', cooldown: int | float = 0, interval: int | float = 0, *, async_: Literal[True], **request_kwargs) AsyncIterator[dict]
持续拉取 115 的历史记录
Note
当你指定有
from_id != 0时,如果 from_time 为 0,则自动重设为 -1- Parameters:
client – 115 客户端或 cookies
from_id – 开始的事件 id (不含)
from_time – 开始时间(含),若为 0 则从当前时间开始,若 < 0 则从最早开始
type –
拉取指定类型的历史记录(??表示还未搞清楚),多个用逗号 “,” 隔开
全部: 0
??: 1
离线下载: 2
播放视频: 3
上传: 4
??: 5
??: 6
接收: 7
移动: 8
ignore_types – 一组要被忽略的操作事件类型代码,仅当 type 为空时生效
cooldown – 冷却时间,大于 0 时,两次接口调用之间至少间隔这么多秒
interval – 两个批量拉取之间的睡眠时间间隔,如果小于等于 0,则不睡眠
app – 使用某个 app (设备)的接口
async – 是否异步
request_kwargs – 其它请求参数
- Returns:
迭代器,产生 115 的历史记录数据字典
- p115client.tool.history.iter_history_list(client: str | PathLike | P115Client, from_id: int = 0, from_time: float = 0, type: int | str = 0, ignore_types: None | Container[int] = None, app: str = 'web', cooldown: int | float = 0, *, async_: Literal[False] = False, **request_kwargs) Iterator[dict][source]¶
- p115client.tool.history.iter_history_list(client: str | PathLike | P115Client, from_id: int = 0, from_time: float = 0, type: int | str = 0, ignore_types: None | Container[int] = None, app: str = 'web', cooldown: int | float = 0, *, async_: Literal[True], **request_kwargs) AsyncIterator[dict]
持续拉取 115 的历史记录
Note
当你指定有
from_id != 0时,如果 from_time 为 0,则自动重设为 -1- Parameters:
client – 115 客户端或 cookies
from_id – 开始的事件 id (不含)
from_time – 开始时间(含),若为 0 则从当前时间开始,若 < 0 则从最早开始
type –
拉取指定类型的历史记录(??表示还未搞清楚),多个用逗号 “,” 隔开
全部: 0
??: 1
离线下载: 2
播放视频: 3
上传: 4
??: 5
??: 6
接收: 7
移动: 8
ignore_types – 一组要被忽略的操作事件类型代码,仅当 type 为空时生效
cooldown – 冷却时间,大于 0 时,两次接口调用之间至少间隔这么多秒
app – 使用某个 app (设备)的接口
async – 是否异步
request_kwargs – 其它请求参数
- Returns:
迭代器,产生 115 的历史记录数据字典
- p115client.tool.history.iter_history_once(client: str | PathLike | P115Client, from_id: int = 0, from_time: float = 0, type: int | str = 0, ignore_types: None | Container[int] = None, first_batch_size=0, app: str = 'web', cooldown: int | float = 0, *, async_: Literal[False] = False, **request_kwargs) Iterator[dict][source]¶
- p115client.tool.history.iter_history_once(client: str | PathLike | P115Client, from_id: int = 0, from_time: float = 0, type: int | str = 0, ignore_types: None | Container[int] = None, first_batch_size=0, app: str = 'web', cooldown: int | float = 0, *, async_: Literal[True], **request_kwargs) AsyncIterator[dict]
拉取一组 115 的历史记录
Note
当你指定有
from_id != 0时,如果 from_time 为 0,则自动重设为 -1- Parameters:
client – 115 客户端或 cookies
from_id – 开始的事件 id (不含)
from_time – 开始时间(含),若为 0 则从当前时间开始,若 < 0 则从最早开始
type –
拉取指定类型的历史记录(??表示还未搞清楚),多个用逗号 “,” 隔开
全部: 0
??: 1
离线下载: 2
播放视频: 3
上传: 4
??: 5
??: 6
接收: 7
移动: 8
ignore_types – 一组要被忽略的操作事件类型代码,仅当 type 为空时生效
first_batch_size – 首批的拉取数目
app – 使用某个 app (设备)的接口
cooldown – 冷却时间,大于 0 时,两次接口调用之间至少间隔这么多秒
async – 是否异步
request_kwargs – 其它请求参数
- Returns:
迭代器,产生 115 的历史记录数据字典