p115client 0.0.5.10__tar.gz → 0.0.5.10.2__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 (25) hide show
  1. {p115client-0.0.5.10 → p115client-0.0.5.10.2}/PKG-INFO +2 -2
  2. {p115client-0.0.5.10 → p115client-0.0.5.10.2}/p115client/client.py +22 -22
  3. {p115client-0.0.5.10 → p115client-0.0.5.10.2}/p115client/const.py +11 -4
  4. {p115client-0.0.5.10 → p115client-0.0.5.10.2}/p115client/tool/xys.py +1 -1
  5. {p115client-0.0.5.10 → p115client-0.0.5.10.2}/pyproject.toml +2 -2
  6. {p115client-0.0.5.10 → p115client-0.0.5.10.2}/LICENSE +0 -0
  7. {p115client-0.0.5.10 → p115client-0.0.5.10.2}/p115client/__init__.py +0 -0
  8. {p115client-0.0.5.10 → p115client-0.0.5.10.2}/p115client/_upload.py +0 -0
  9. {p115client-0.0.5.10 → p115client-0.0.5.10.2}/p115client/exception.py +0 -0
  10. {p115client-0.0.5.10 → p115client-0.0.5.10.2}/p115client/py.typed +0 -0
  11. {p115client-0.0.5.10 → p115client-0.0.5.10.2}/p115client/tool/__init__.py +0 -0
  12. {p115client-0.0.5.10 → p115client-0.0.5.10.2}/p115client/tool/attr.py +0 -0
  13. {p115client-0.0.5.10 → p115client-0.0.5.10.2}/p115client/tool/download.py +0 -0
  14. {p115client-0.0.5.10 → p115client-0.0.5.10.2}/p115client/tool/edit.py +0 -0
  15. {p115client-0.0.5.10 → p115client-0.0.5.10.2}/p115client/tool/export_dir.py +0 -0
  16. {p115client-0.0.5.10 → p115client-0.0.5.10.2}/p115client/tool/fs_files.py +0 -0
  17. {p115client-0.0.5.10 → p115client-0.0.5.10.2}/p115client/tool/history.py +0 -0
  18. {p115client-0.0.5.10 → p115client-0.0.5.10.2}/p115client/tool/iterdir.py +0 -0
  19. {p115client-0.0.5.10 → p115client-0.0.5.10.2}/p115client/tool/life.py +0 -0
  20. {p115client-0.0.5.10 → p115client-0.0.5.10.2}/p115client/tool/pool.py +0 -0
  21. {p115client-0.0.5.10 → p115client-0.0.5.10.2}/p115client/tool/request.py +0 -0
  22. {p115client-0.0.5.10 → p115client-0.0.5.10.2}/p115client/tool/upload.py +0 -0
  23. {p115client-0.0.5.10 → p115client-0.0.5.10.2}/p115client/tool/util.py +0 -0
  24. {p115client-0.0.5.10 → p115client-0.0.5.10.2}/p115client/type.py +0 -0
  25. {p115client-0.0.5.10 → p115client-0.0.5.10.2}/readme.md +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: p115client
3
- Version: 0.0.5.10
3
+ Version: 0.0.5.10.2
4
4
  Summary: Python 115 webdisk client.
5
5
  Home-page: https://github.com/ChenyangGao/p115client
6
6
  License: MIT
@@ -40,7 +40,7 @@ Requires-Dist: python-filewrap (>=0.2.8)
40
40
  Requires-Dist: python-hashtools (>=0.0.3.3)
41
41
  Requires-Dist: python-http_request (>=0.0.6)
42
42
  Requires-Dist: python-httpfile (>=0.0.5.2)
43
- Requires-Dist: python-iterutils (>=0.1.10)
43
+ Requires-Dist: python-iterutils (>=0.1.11)
44
44
  Requires-Dist: python-property (>=0.0.3)
45
45
  Requires-Dist: python-startfile (>=0.0.2)
46
46
  Requires-Dist: python-undefined (>=0.0.3)
@@ -1363,7 +1363,7 @@ class ClientRequestMixin:
1363
1363
 
1364
1364
  POST https://qrcodeapi.115.com/open/deviceCodeToToken
1365
1365
 
1366
- .. note::
1366
+ .. admonition:: Reference
1367
1367
  https://www.yuque.com/115yun/open/shtpzfhewv5nag11#QCCVQ
1368
1368
 
1369
1369
  :payload:
@@ -1414,7 +1414,7 @@ class ClientRequestMixin:
1414
1414
 
1415
1415
  POST https://qrcodeapi.115.com/open/refreshToken
1416
1416
 
1417
- .. note::
1417
+ .. admonition:: Reference
1418
1418
  https://www.yuque.com/115yun/open/shtpzfhewv5nag11#ve54x
1419
1419
 
1420
1420
  :payload:
@@ -1566,7 +1566,7 @@ class ClientRequestMixin:
1566
1566
 
1567
1567
  GET https://qrcodeapi.115.com/get/status/
1568
1568
 
1569
- .. note::
1569
+ .. admonition:: Reference
1570
1570
  https://www.yuque.com/115yun/open/shtpzfhewv5nag11#lAsp2
1571
1571
 
1572
1572
  :payload:
@@ -1652,9 +1652,10 @@ class ClientRequestMixin:
1652
1652
 
1653
1653
  POST https://qrcodeapi.115.com/open/authDeviceCode
1654
1654
 
1655
- .. note::
1655
+ .. admonition:: Reference
1656
1656
  https://www.yuque.com/115yun/open/shtpzfhewv5nag11#WzRhM
1657
1657
 
1658
+ .. note::
1658
1659
  code_challenge 默认用的字符串为 64 个 0,hash 算法为 md5
1659
1660
 
1660
1661
  :payload:
@@ -2462,7 +2463,7 @@ class ClientRequestMixin:
2462
2463
  class P115OpenClient(ClientRequestMixin):
2463
2464
  """115 的客户端对象
2464
2465
 
2465
- .. note::
2466
+ .. admonition:: Reference
2466
2467
  https://www.yuque.com/115yun/open
2467
2468
 
2468
2469
  :param app_id_or_refresh_token: 申请到的 AppID 或 refresh_token
@@ -2745,7 +2746,7 @@ class P115OpenClient(ClientRequestMixin):
2745
2746
  .. hint::
2746
2747
  相当于 `P115Client.download_url_app(app="chrome")`
2747
2748
 
2748
- .. note::
2749
+ .. admonition:: Reference
2749
2750
  https://www.yuque.com/115yun/open/um8whr91bxb5997o
2750
2751
 
2751
2752
  :payload:
@@ -2808,7 +2809,7 @@ class P115OpenClient(ClientRequestMixin):
2808
2809
 
2809
2810
  POST https://proapi.115.com/open/ufile/copy
2810
2811
 
2811
- .. note::
2812
+ .. admonition:: Reference
2812
2813
  https://www.yuque.com/115yun/open/lvas49ar94n47bbk
2813
2814
 
2814
2815
  :payload:
@@ -2864,7 +2865,7 @@ class P115OpenClient(ClientRequestMixin):
2864
2865
 
2865
2866
  POST https://proapi.115.com/open/ufile/delete
2866
2867
 
2867
- .. note::
2868
+ .. admonition:: Reference
2868
2869
  https://www.yuque.com/115yun/open/kt04fu8vcchd2fnb
2869
2870
 
2870
2871
  :payload:
@@ -2915,7 +2916,7 @@ class P115OpenClient(ClientRequestMixin):
2915
2916
  .. hint::
2916
2917
  相当于 `P115Client.fs_files_app`
2917
2918
 
2918
- .. note::
2919
+ .. admonition:: Reference
2919
2920
  https://www.yuque.com/115yun/open/kz9ft9a7s57ep868
2920
2921
 
2921
2922
  :payload:
@@ -3034,7 +3035,7 @@ class P115OpenClient(ClientRequestMixin):
3034
3035
  .. hint::
3035
3036
  相当于 `P115Client.fs_category_get_app`
3036
3037
 
3037
- .. note::
3038
+ .. admonition:: Reference
3038
3039
  https://www.yuque.com/115yun/open/rl8zrhe2nag21dfw
3039
3040
 
3040
3041
  :payload:
@@ -3083,7 +3084,7 @@ class P115OpenClient(ClientRequestMixin):
3083
3084
 
3084
3085
  POST https://proapi.115.com/open/folder/add
3085
3086
 
3086
- .. note::
3087
+ .. admonition:: Reference
3087
3088
  https://www.yuque.com/115yun/open/qur839kyx9cgxpxi
3088
3089
 
3089
3090
  :payload:
@@ -3135,7 +3136,7 @@ class P115OpenClient(ClientRequestMixin):
3135
3136
 
3136
3137
  POST https://proapi.115.com/open/ufile/move
3137
3138
 
3138
- .. note::
3139
+ .. admonition:: Reference
3139
3140
  https://www.yuque.com/115yun/open/vc6fhi2mrkenmav2
3140
3141
 
3141
3142
  :payload:
@@ -3193,7 +3194,7 @@ class P115OpenClient(ClientRequestMixin):
3193
3194
  .. hint::
3194
3195
  相当于 `P115Client.fs_search_app2`
3195
3196
 
3196
- .. note::
3197
+ .. admonition:: Reference
3197
3198
  https://www.yuque.com/115yun/open/ft2yelxzopusus38
3198
3199
 
3199
3200
  :payload:
@@ -3348,7 +3349,7 @@ class P115OpenClient(ClientRequestMixin):
3348
3349
  .. hint::
3349
3350
  即使文件已经被删除,也可以操作成功
3350
3351
 
3351
- .. note::
3352
+ .. admonition:: Reference
3352
3353
  https://www.yuque.com/115yun/open/gyrpw5a0zc4sengm
3353
3354
 
3354
3355
  :payload:
@@ -3446,7 +3447,7 @@ class P115OpenClient(ClientRequestMixin):
3446
3447
 
3447
3448
  GET https://proapi.115.com/open/rb/list
3448
3449
 
3449
- .. note::
3450
+ .. admonition:: Reference
3450
3451
  https://www.yuque.com/115yun/open/bg7l4328t98fwgex
3451
3452
 
3452
3453
  :payload:
@@ -3495,7 +3496,7 @@ class P115OpenClient(ClientRequestMixin):
3495
3496
 
3496
3497
  POST https://proapi.115.com/open/rb/revert
3497
3498
 
3498
- .. note::
3499
+ .. admonition:: Reference
3499
3500
  https://www.yuque.com/115yun/open/gq293z80a3kmxbaq
3500
3501
 
3501
3502
  :payload:
@@ -3540,7 +3541,7 @@ class P115OpenClient(ClientRequestMixin):
3540
3541
 
3541
3542
  GET https://proapi.115.com/open/upload/get_token
3542
3543
 
3543
- .. note::
3544
+ .. admonition:: Reference
3544
3545
  https://www.yuque.com/115yun/open/kzacvzl0g7aiyyn4
3545
3546
  """
3546
3547
  api = complete_proapi("/open/upload/get_token", base_url)
@@ -3581,7 +3582,7 @@ class P115OpenClient(ClientRequestMixin):
3581
3582
 
3582
3583
  POST https://proapi.115.com/open/upload/init
3583
3584
 
3584
- .. note::
3585
+ .. admonition:: Reference
3585
3586
  https://www.yuque.com/115yun/open/ul4mrauo5i2uza0q
3586
3587
 
3587
3588
  :payload:
@@ -3639,7 +3640,7 @@ class P115OpenClient(ClientRequestMixin):
3639
3640
 
3640
3641
  POST https://proapi.115.com/open/upload/resume
3641
3642
 
3642
- .. note::
3643
+ .. admonition:: Reference
3643
3644
  https://www.yuque.com/115yun/open/tzvi9sbcg59msddz
3644
3645
 
3645
3646
  :payload:
@@ -4129,7 +4130,7 @@ class P115OpenClient(ClientRequestMixin):
4129
4130
 
4130
4131
  GET https://proapi.115.com/open/user/info
4131
4132
 
4132
- .. note::
4133
+ .. admonition:: Reference
4133
4134
  https://www.yuque.com/115yun/open/ot1litggzxa1czww
4134
4135
  """
4135
4136
  api = complete_proapi("/open/user/info", base_url)
@@ -5473,8 +5474,7 @@ class P115Client(P115OpenClient):
5473
5474
  request_kwargs["session"] = self.async_session if async_ else self.session
5474
5475
  request_kwargs["async_"] = async_
5475
5476
  request = get_default_request()
5476
- else:
5477
- headers.merge(self.headers)
5477
+ headers.merge(self.headers)
5478
5478
  if is_open_api:
5479
5479
  headers["cookie"] = ""
5480
5480
  if m := CRE_API_match(url):
@@ -1,10 +1,12 @@
1
1
  #!/usr/bin/env python3
2
2
  # encoding: utf-8
3
3
 
4
+ from __future__ import annotations
5
+
4
6
  __author__ = "ChenyangGao <https://chenyanggao.github.io>"
5
7
  __all__ = [
6
- "AVAILABLE_APP_IDS", "AVAILABLE_APPS", "APP_TO_SSOENT",
7
- "SSOENT_TO_APP", "CLIENT_API_MAP", "errno",
8
+ "AVAILABLE_APP_IDS", "AVAILABLE_APPS", "APP_TO_SSOENT", "SSOENT_TO_APP",
9
+ "CLIENT_API_MAP", "CLASS_TO_TYPE", "SUFFIX_TO_TYPE", "errno",
8
10
  ]
9
11
 
10
12
  from enum import IntEnum
@@ -218,8 +220,13 @@ SUFFIX_TO_TYPE: Final[dict[str, int]] = {
218
220
  ".prc": 7,
219
221
  }
220
222
 
221
- #: OSError 的错误码的枚举,参考:https://docs.python.org/3/library/errno.html
222
223
  class errno(IntEnum):
224
+ """OSError 的错误码的枚举
225
+
226
+ .. admonition:: Reference
227
+
228
+ https://docs.python.org/3/library/errno.html
229
+ """
223
230
  EPERM = 1
224
231
  ENOENT = 2
225
232
  ESRCH = 3
@@ -375,7 +382,7 @@ class errno(IntEnum):
375
382
  EOWNERDEAD = 153
376
383
  ENOTRECOVERABLE = 154
377
384
 
378
- def of(key, /):
385
+ def of(key: int | str | errno, /) -> errno:
379
386
  if isinstance(key, errno):
380
387
  return key
381
388
  if isinstance(key, int):
@@ -246,7 +246,7 @@ def wish_del(
246
246
  async_: Literal[False, True] = False,
247
247
  **request_kwargs,
248
248
  ) -> dict | Coroutine[Any, Any, dict]:
249
- """许愿树活动:许愿信息
249
+ """许愿树活动:删除许愿
250
250
 
251
251
  :param client: 115 客户端或 cookies
252
252
  :param wish_id: 许愿 id
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "p115client"
3
- version = "0.0.5.10"
3
+ version = "0.0.5.10.2"
4
4
  description = "Python 115 webdisk client."
5
5
  authors = ["ChenyangGao <wosiwujm@gmail.com>"]
6
6
  license = "MIT"
@@ -48,7 +48,7 @@ python-filewrap = ">=0.2.8"
48
48
  python-hashtools = ">=0.0.3.3"
49
49
  python-httpfile = ">=0.0.5.2"
50
50
  python-http_request = ">=0.0.6"
51
- python-iterutils = ">=0.1.10"
51
+ python-iterutils = ">=0.1.11"
52
52
  python-property = ">=0.0.3"
53
53
  python-startfile = ">=0.0.2"
54
54
  python-undefined = ">=0.0.3"
File without changes
File without changes