p115client 0.0.5.6__tar.gz → 0.0.5.6.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 (22) hide show
  1. {p115client-0.0.5.6 → p115client-0.0.5.6.2}/PKG-INFO +41 -1
  2. {p115client-0.0.5.6 → p115client-0.0.5.6.2}/p115client/client.py +9551 -9493
  3. {p115client-0.0.5.6 → p115client-0.0.5.6.2}/p115client/tool/fs_files.py +30 -15
  4. {p115client-0.0.5.6 → p115client-0.0.5.6.2}/pyproject.toml +1 -1
  5. {p115client-0.0.5.6 → p115client-0.0.5.6.2}/readme.md +40 -0
  6. {p115client-0.0.5.6 → p115client-0.0.5.6.2}/LICENSE +0 -0
  7. {p115client-0.0.5.6 → p115client-0.0.5.6.2}/p115client/__init__.py +0 -0
  8. {p115client-0.0.5.6 → p115client-0.0.5.6.2}/p115client/_upload.py +0 -0
  9. {p115client-0.0.5.6 → p115client-0.0.5.6.2}/p115client/const.py +0 -0
  10. {p115client-0.0.5.6 → p115client-0.0.5.6.2}/p115client/exception.py +0 -0
  11. {p115client-0.0.5.6 → p115client-0.0.5.6.2}/p115client/py.typed +0 -0
  12. {p115client-0.0.5.6 → p115client-0.0.5.6.2}/p115client/tool/__init__.py +0 -0
  13. {p115client-0.0.5.6 → p115client-0.0.5.6.2}/p115client/tool/download.py +0 -0
  14. {p115client-0.0.5.6 → p115client-0.0.5.6.2}/p115client/tool/edit.py +0 -0
  15. {p115client-0.0.5.6 → p115client-0.0.5.6.2}/p115client/tool/export_dir.py +0 -0
  16. {p115client-0.0.5.6 → p115client-0.0.5.6.2}/p115client/tool/iterdir.py +0 -0
  17. {p115client-0.0.5.6 → p115client-0.0.5.6.2}/p115client/tool/life.py +0 -0
  18. {p115client-0.0.5.6 → p115client-0.0.5.6.2}/p115client/tool/pool.py +0 -0
  19. {p115client-0.0.5.6 → p115client-0.0.5.6.2}/p115client/tool/request.py +0 -0
  20. {p115client-0.0.5.6 → p115client-0.0.5.6.2}/p115client/tool/upload.py +0 -0
  21. {p115client-0.0.5.6 → p115client-0.0.5.6.2}/p115client/tool/xys.py +0 -0
  22. {p115client-0.0.5.6 → p115client-0.0.5.6.2}/p115client/type.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: p115client
3
- Version: 0.0.5.6
3
+ Version: 0.0.5.6.2
4
4
  Summary: Python 115 webdisk client.
5
5
  Home-page: https://github.com/ChenyangGao/p115client
6
6
  License: MIT
@@ -106,6 +106,46 @@ from pathlib import Path
106
106
  client = P115Client(Path("~/115-cookies.txt").expanduser(), check_for_relogin=True)
107
107
  ```
108
108
 
109
+ 如果你有一个申请通过的开放接口的应用,则可以创建开放接口的客户端实例
110
+
111
+ 你可以直接从一个 `P115Client` 实例拿到授权(自动扫码登录并授权)
112
+
113
+ ```python
114
+ app_id = <开放接口应用的 AppID>
115
+ client_open = client.login_another_open(app_id)
116
+ ```
117
+
118
+ 你也可以直接在 `P115Client` 实例上使用开放接口,此时会使用 `P115OpenClient` 的对应方法,但名字多一个 "_open" 后缀
119
+
120
+ ```python
121
+ # 此时 client.fs_files_open 相当于 client_open.fs_files
122
+ client.login_another_open(app_id, replace=True)
123
+ ```
124
+
125
+ 也可以用一个已经授权得到的 `refresh_token` (一次性使用)
126
+
127
+ ```python
128
+ from p115client import P115OpenClient
129
+
130
+ client_open = P115OpenClient(refresh_token)
131
+ ```
132
+
133
+ 或者手动扫码登录
134
+
135
+ ```python
136
+ client_open = P115OpenClient(app_id)
137
+ ```
138
+
139
+ 所以综上,推荐的初始化代码为
140
+
141
+ ```python
142
+ from p115client import P115Client, P115OpenClient
143
+ from pathlib import Path
144
+
145
+ client = P115Client(Path("~/115-cookies.txt").expanduser(), check_for_relogin=True)
146
+ client_open = client.login_another_open(app_id)
147
+ ```
148
+
109
149
  ### 2. 接口调用
110
150
 
111
151
  所有需要直接或间接执行 HTTP 请求的接口,都有同步和异步的调用方式