p115client 0.0.5.11.9.1__tar.gz → 0.0.5.11.10.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. {p115client-0.0.5.11.9.1 → p115client-0.0.5.11.10.1}/PKG-INFO +1 -1
  2. {p115client-0.0.5.11.9.1 → p115client-0.0.5.11.10.1}/p115client/client.py +94 -1
  3. {p115client-0.0.5.11.9.1 → p115client-0.0.5.11.10.1}/p115client/tool/fs_files.py +2 -0
  4. {p115client-0.0.5.11.9.1 → p115client-0.0.5.11.10.1}/p115client/tool/upload.py +0 -1
  5. {p115client-0.0.5.11.9.1 → p115client-0.0.5.11.10.1}/pyproject.toml +1 -1
  6. {p115client-0.0.5.11.9.1 → p115client-0.0.5.11.10.1}/LICENSE +0 -0
  7. {p115client-0.0.5.11.9.1 → p115client-0.0.5.11.10.1}/p115client/__init__.py +0 -0
  8. {p115client-0.0.5.11.9.1 → p115client-0.0.5.11.10.1}/p115client/_upload.py +0 -0
  9. {p115client-0.0.5.11.9.1 → p115client-0.0.5.11.10.1}/p115client/const.py +0 -0
  10. {p115client-0.0.5.11.9.1 → p115client-0.0.5.11.10.1}/p115client/exception.py +0 -0
  11. {p115client-0.0.5.11.9.1 → p115client-0.0.5.11.10.1}/p115client/py.typed +0 -0
  12. {p115client-0.0.5.11.9.1 → p115client-0.0.5.11.10.1}/p115client/tool/__init__.py +0 -0
  13. {p115client-0.0.5.11.9.1 → p115client-0.0.5.11.10.1}/p115client/tool/attr.py +0 -0
  14. {p115client-0.0.5.11.9.1 → p115client-0.0.5.11.10.1}/p115client/tool/auth.py +0 -0
  15. {p115client-0.0.5.11.9.1 → p115client-0.0.5.11.10.1}/p115client/tool/download.py +0 -0
  16. {p115client-0.0.5.11.9.1 → p115client-0.0.5.11.10.1}/p115client/tool/edit.py +0 -0
  17. {p115client-0.0.5.11.9.1 → p115client-0.0.5.11.10.1}/p115client/tool/export_dir.py +0 -0
  18. {p115client-0.0.5.11.9.1 → p115client-0.0.5.11.10.1}/p115client/tool/history.py +0 -0
  19. {p115client-0.0.5.11.9.1 → p115client-0.0.5.11.10.1}/p115client/tool/iterdir.py +0 -0
  20. {p115client-0.0.5.11.9.1 → p115client-0.0.5.11.10.1}/p115client/tool/life.py +0 -0
  21. {p115client-0.0.5.11.9.1 → p115client-0.0.5.11.10.1}/p115client/tool/pool.py +0 -0
  22. {p115client-0.0.5.11.9.1 → p115client-0.0.5.11.10.1}/p115client/tool/request.py +0 -0
  23. {p115client-0.0.5.11.9.1 → p115client-0.0.5.11.10.1}/p115client/tool/util.py +0 -0
  24. {p115client-0.0.5.11.9.1 → p115client-0.0.5.11.10.1}/p115client/tool/xys.py +0 -0
  25. {p115client-0.0.5.11.9.1 → p115client-0.0.5.11.10.1}/p115client/type.py +0 -0
  26. {p115client-0.0.5.11.9.1 → p115client-0.0.5.11.10.1}/readme.md +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: p115client
3
- Version: 0.0.5.11.9.1
3
+ Version: 0.0.5.11.10.1
4
4
  Summary: Python 115 webdisk client.
5
5
  Home-page: https://github.com/ChenyangGao/p115client
6
6
  License: MIT
@@ -14149,6 +14149,49 @@ class P115Client(P115OpenClient):
14149
14149
  payload = {"file_id": 0, "user_asc": 1, "user_order": "user_ptime", **payload}
14150
14150
  return self.request(url=api, method="POST", data=payload, async_=async_, **request_kwargs)
14151
14151
 
14152
+ @overload
14153
+ def fs_preview(
14154
+ self,
14155
+ payload: str | dict,
14156
+ /,
14157
+ base_url: bool | str | Callable[[], str] = False,
14158
+ *,
14159
+ async_: Literal[False] = False,
14160
+ **request_kwargs,
14161
+ ) -> dict:
14162
+ ...
14163
+ @overload
14164
+ def fs_preview(
14165
+ self,
14166
+ payload: str | dict,
14167
+ /,
14168
+ base_url: bool | str | Callable[[], str] = False,
14169
+ *,
14170
+ async_: Literal[True],
14171
+ **request_kwargs,
14172
+ ) -> Coroutine[Any, Any, dict]:
14173
+ ...
14174
+ def fs_preview(
14175
+ self,
14176
+ payload: str | dict,
14177
+ /,
14178
+ base_url: bool | str | Callable[[], str] = False,
14179
+ *,
14180
+ async_: Literal[False, True] = False,
14181
+ **request_kwargs,
14182
+ ) -> dict | Coroutine[Any, Any, dict]:
14183
+ """文档预览
14184
+
14185
+ POST https://webapi.115.com/files/preview
14186
+
14187
+ :payload:
14188
+ - pickcode: str 💡 提取码
14189
+ """
14190
+ api = complete_webapi("/files/preview", base_url=base_url)
14191
+ if isinstance(payload, str):
14192
+ payload = {"pickcode": payload}
14193
+ return self.request(url=api, method="POST", data=payload, async_=async_, **request_kwargs)
14194
+
14152
14195
  @overload
14153
14196
  def fs_rename(
14154
14197
  self,
@@ -18315,7 +18358,7 @@ class P115Client(P115OpenClient):
18315
18358
  ) -> dict | Coroutine[Any, Any, dict]:
18316
18359
  """删除一组离线任务(无论是否已经完成)
18317
18360
 
18318
- POST https://lixian.115.com/lixianssp/?ac=task_del
18361
+ POST https://lixian.115.com/lixian/?ac=task_del
18319
18362
 
18320
18363
  :payload:
18321
18364
  - hash[0]: str
@@ -18332,6 +18375,56 @@ class P115Client(P115OpenClient):
18332
18375
  raise ValueError("no `hash` (info_hash) specified")
18333
18376
  return self.request(api, method="POST", data=payload, async_=async_, **request_kwargs)
18334
18377
 
18378
+ @overload
18379
+ def offline_restart(
18380
+ self,
18381
+ payload: str | dict,
18382
+ /,
18383
+ base_url: None | bool | str | Callable[[], str] = None,
18384
+ method: str = "POST",
18385
+ *,
18386
+ async_: Literal[False] = False,
18387
+ **request_kwargs,
18388
+ ) -> dict:
18389
+ ...
18390
+ @overload
18391
+ def offline_restart(
18392
+ self,
18393
+ payload: str | dict,
18394
+ /,
18395
+ base_url: None | bool | str | Callable[[], str] = None,
18396
+ method: str = "POST",
18397
+ *,
18398
+ async_: Literal[True],
18399
+ **request_kwargs,
18400
+ ) -> Coroutine[Any, Any, dict]:
18401
+ ...
18402
+ def offline_restart(
18403
+ self,
18404
+ payload: str | dict,
18405
+ /,
18406
+ base_url: None | bool | str | Callable[[], str] = None,
18407
+ method: str = "POST",
18408
+ *,
18409
+ async_: Literal[False, True] = False,
18410
+ **request_kwargs,
18411
+ ) -> dict | Coroutine[Any, Any, dict]:
18412
+ """重试用户云下载任务
18413
+
18414
+ POST https://lixian.115.com/lixian/?ac=restart
18415
+
18416
+ :payload:
18417
+ - info_hash: str 💡 待重试任务的 info_hash
18418
+ """
18419
+ api = complete_lixian_api("?ct=lixian&ac=restart", base_url=base_url)
18420
+ if isinstance(payload, str):
18421
+ payload = {"info_hash": payload}
18422
+ if method.upper() == "POST":
18423
+ request_kwargs["data"] = payload
18424
+ else:
18425
+ request_kwargs["params"] = payload
18426
+ return self.request(api, method=method, async_=async_, **request_kwargs)
18427
+
18335
18428
  @overload
18336
18429
  def offline_task_count(
18337
18430
  self,
@@ -196,6 +196,7 @@ def iter_fs_files_threaded(
196
196
  }
197
197
  cid = int(payload["cid"])
198
198
  if not isinstance(client, P115Client) or app == "open":
199
+ page_size = min(page_size, 1150)
199
200
  fs_files = partial(client.fs_files_open, **request_kwargs)
200
201
  elif app in ("", "web", "desktop", "harmony"):
201
202
  page_size = min(page_size, 1150)
@@ -310,6 +311,7 @@ async def iter_fs_files_asynchronized(
310
311
  }
311
312
  cid = int(payload["cid"])
312
313
  if not isinstance(client, P115Client) or app == "open":
314
+ page_size = min(page_size, 1150)
313
315
  fs_files = partial(client.fs_files_open, **request_kwargs)
314
316
  elif app in ("", "web", "desktop", "harmony"):
315
317
  page_size = min(page_size, 1150)
@@ -867,4 +867,3 @@ def multipart_upload_complete(
867
867
  )
868
868
  return run_gen_step(gen_step, async_=async_)
869
869
 
870
- # TODO: 分块上传支持使用开放接口
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "p115client"
3
- version = "0.0.5.11.9.1"
3
+ version = "0.0.5.11.10.1"
4
4
  description = "Python 115 webdisk client."
5
5
  authors = ["ChenyangGao <wosiwujm@gmail.com>"]
6
6
  license = "MIT"