p115client 0.0.5.6.5__tar.gz → 0.0.5.6.7__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.
- {p115client-0.0.5.6.5 → p115client-0.0.5.6.7}/PKG-INFO +1 -1
- {p115client-0.0.5.6.5 → p115client-0.0.5.6.7}/p115client/client.py +11 -31
- {p115client-0.0.5.6.5 → p115client-0.0.5.6.7}/p115client/tool/fs_files.py +4 -4
- {p115client-0.0.5.6.5 → p115client-0.0.5.6.7}/pyproject.toml +1 -1
- {p115client-0.0.5.6.5 → p115client-0.0.5.6.7}/LICENSE +0 -0
- {p115client-0.0.5.6.5 → p115client-0.0.5.6.7}/p115client/__init__.py +0 -0
- {p115client-0.0.5.6.5 → p115client-0.0.5.6.7}/p115client/_upload.py +0 -0
- {p115client-0.0.5.6.5 → p115client-0.0.5.6.7}/p115client/const.py +0 -0
- {p115client-0.0.5.6.5 → p115client-0.0.5.6.7}/p115client/exception.py +0 -0
- {p115client-0.0.5.6.5 → p115client-0.0.5.6.7}/p115client/py.typed +0 -0
- {p115client-0.0.5.6.5 → p115client-0.0.5.6.7}/p115client/tool/__init__.py +0 -0
- {p115client-0.0.5.6.5 → p115client-0.0.5.6.7}/p115client/tool/download.py +0 -0
- {p115client-0.0.5.6.5 → p115client-0.0.5.6.7}/p115client/tool/edit.py +0 -0
- {p115client-0.0.5.6.5 → p115client-0.0.5.6.7}/p115client/tool/export_dir.py +0 -0
- {p115client-0.0.5.6.5 → p115client-0.0.5.6.7}/p115client/tool/iterdir.py +0 -0
- {p115client-0.0.5.6.5 → p115client-0.0.5.6.7}/p115client/tool/life.py +0 -0
- {p115client-0.0.5.6.5 → p115client-0.0.5.6.7}/p115client/tool/pool.py +0 -0
- {p115client-0.0.5.6.5 → p115client-0.0.5.6.7}/p115client/tool/request.py +0 -0
- {p115client-0.0.5.6.5 → p115client-0.0.5.6.7}/p115client/tool/upload.py +0 -0
- {p115client-0.0.5.6.5 → p115client-0.0.5.6.7}/p115client/tool/xys.py +0 -0
- {p115client-0.0.5.6.5 → p115client-0.0.5.6.7}/p115client/type.py +0 -0
- {p115client-0.0.5.6.5 → p115client-0.0.5.6.7}/readme.md +0 -0
@@ -4043,7 +4043,7 @@ class P115OpenClient(ClientRequestMixin):
|
|
4043
4043
|
vip_qr_url_open = vip_qr_url
|
4044
4044
|
|
4045
4045
|
|
4046
|
-
class P115Client(
|
4046
|
+
class P115Client(P115OpenClient):
|
4047
4047
|
"""115 的客户端对象
|
4048
4048
|
|
4049
4049
|
:param cookies: 115 的 cookies,要包含 `UID`、`CID`、`KID` 和 `SEID` 等
|
@@ -4266,7 +4266,7 @@ class P115Client(ClientRequestMixin):
|
|
4266
4266
|
except OSError:
|
4267
4267
|
self.cookies_mtime = 0
|
4268
4268
|
|
4269
|
-
@overload
|
4269
|
+
@overload # type: ignore
|
4270
4270
|
@classmethod
|
4271
4271
|
def init(
|
4272
4272
|
cls,
|
@@ -5256,6 +5256,9 @@ class P115Client(ClientRequestMixin):
|
|
5256
5256
|
elif data is not None:
|
5257
5257
|
request_kwargs["data"] = data
|
5258
5258
|
request_kwargs.setdefault("parse", default_parse)
|
5259
|
+
if url.startswith("https://proapi.115.com/open/"):
|
5260
|
+
headers["cookie"] = ""
|
5261
|
+
return request(url=url, method=method, **request_kwargs)
|
5259
5262
|
def gen_step():
|
5260
5263
|
check_for_relogin = self.check_for_relogin
|
5261
5264
|
cant_relogin = not callable(check_for_relogin)
|
@@ -16665,7 +16668,7 @@ class P115Client(ClientRequestMixin):
|
|
16665
16668
|
|
16666
16669
|
########## Recyclebin API ##########
|
16667
16670
|
|
16668
|
-
@overload
|
16671
|
+
@overload # type: ignore
|
16669
16672
|
def recyclebin_clean(
|
16670
16673
|
self,
|
16671
16674
|
payload: int | str | Iterable[int | str] | dict = {},
|
@@ -18462,7 +18465,7 @@ class P115Client(ClientRequestMixin):
|
|
18462
18465
|
api = complete_proapi("/app/uploadinfo", base_url)
|
18463
18466
|
return self.request(url=api, async_=async_, **request_kwargs)
|
18464
18467
|
|
18465
|
-
@overload
|
18468
|
+
@overload # type: ignore
|
18466
18469
|
def upload_init(
|
18467
18470
|
self,
|
18468
18471
|
/,
|
@@ -18628,7 +18631,7 @@ class P115Client(ClientRequestMixin):
|
|
18628
18631
|
payload = {"filename": filename, "target": f"U_1_{pid}"}
|
18629
18632
|
return self.request(url=api, method="POST", data=payload, async_=async_, **request_kwargs)
|
18630
18633
|
|
18631
|
-
@overload
|
18634
|
+
@overload # type: ignore
|
18632
18635
|
@staticmethod
|
18633
18636
|
def upload_gettoken(
|
18634
18637
|
request: None | Callable = None,
|
@@ -18801,7 +18804,7 @@ class P115Client(ClientRequestMixin):
|
|
18801
18804
|
request_kwargs.setdefault("parse", parse_upload_init_response)
|
18802
18805
|
return self.upload_init(async_=async_, **request_kwargs)
|
18803
18806
|
|
18804
|
-
@overload
|
18807
|
+
@overload # type: ignore
|
18805
18808
|
def upload_file_init(
|
18806
18809
|
self,
|
18807
18810
|
/,
|
@@ -19047,7 +19050,7 @@ class P115Client(ClientRequestMixin):
|
|
19047
19050
|
|
19048
19051
|
# TODO: 当文件 < 1 MB 时,文件不急着打开,需要时再打开
|
19049
19052
|
# TODO: 对于上传空文件,有特别的速度(sha1写死)
|
19050
|
-
@overload
|
19053
|
+
@overload # type: ignore
|
19051
19054
|
def upload_file(
|
19052
19055
|
self,
|
19053
19056
|
/,
|
@@ -19510,7 +19513,7 @@ class P115Client(ClientRequestMixin):
|
|
19510
19513
|
api = complete_webapi("/user/fingerprint", base_url=base_url)
|
19511
19514
|
return self.request(url=api, async_=async_, **request_kwargs)
|
19512
19515
|
|
19513
|
-
@overload
|
19516
|
+
@overload # type: ignore
|
19514
19517
|
@staticmethod
|
19515
19518
|
def user_info(
|
19516
19519
|
payload: int | str | dict,
|
@@ -20377,29 +20380,6 @@ class P115Client(ClientRequestMixin):
|
|
20377
20380
|
payload = {"ignore_warn": 0, "share_opt": 1, "safe_pwd": "", **payload}
|
20378
20381
|
return self.request(url=api, method="POST", data=payload, async_=async_, **request_kwargs)
|
20379
20382
|
|
20380
|
-
access_token = P115OpenClient.access_token
|
20381
|
-
refresh_access_token = P115OpenClient.refresh_access_token
|
20382
|
-
download_url_open = P115OpenClient.download_url_open
|
20383
|
-
download_url_info_open = P115OpenClient.download_url_info_open
|
20384
|
-
fs_copy_open = P115OpenClient.fs_copy_open
|
20385
|
-
fs_delete_open = P115OpenClient.fs_delete_open
|
20386
|
-
fs_files_open = P115OpenClient.fs_files_open
|
20387
|
-
fs_info_open = P115OpenClient.fs_info_open
|
20388
|
-
fs_mkdir_open = P115OpenClient.fs_mkdir_open
|
20389
|
-
fs_move_open = P115OpenClient.fs_move_open
|
20390
|
-
fs_search_open = P115OpenClient.fs_search_open
|
20391
|
-
fs_update_open = P115OpenClient.fs_update_open
|
20392
|
-
recyclebin_clean_open = P115OpenClient.recyclebin_clean_open
|
20393
|
-
recyclebin_list_open = P115OpenClient.recyclebin_list_open
|
20394
|
-
recyclebin_revert_open = P115OpenClient.recyclebin_revert_open
|
20395
|
-
upload_gettoken_open = P115OpenClient.upload_gettoken_open
|
20396
|
-
upload_init_open = P115OpenClient.upload_init_open
|
20397
|
-
upload_resume_open = P115OpenClient.upload_resume_open
|
20398
|
-
user_info_open = P115OpenClient.user_info_open
|
20399
|
-
upload_file_init_open = P115OpenClient.upload_file_init_open
|
20400
|
-
upload_file_open = P115OpenClient.upload_file_open
|
20401
|
-
vip_qr_url_open = P115OpenClient.vip_qr_url_open
|
20402
|
-
|
20403
20383
|
|
20404
20384
|
for name, method in P115Client.__dict__.items():
|
20405
20385
|
if not (callable(method) and method.__doc__):
|
@@ -121,7 +121,7 @@ def iter_fs_files(
|
|
121
121
|
request_kwargs.setdefault("base_url", get_webapi_origin)
|
122
122
|
fs_files = partial(client.fs_files, **request_kwargs)
|
123
123
|
elif app == "open":
|
124
|
-
fs_files = partial(client.fs_files_open, **request_kwargs)
|
124
|
+
fs_files = partial(client.fs_files_open, **request_kwargs)
|
125
125
|
else:
|
126
126
|
request_kwargs.setdefault("base_url", get_proapi_origin)
|
127
127
|
fs_files = partial(client.fs_files_app, app=app, **request_kwargs)
|
@@ -219,7 +219,7 @@ def iter_fs_files_threaded(
|
|
219
219
|
request_kwargs.setdefault("base_url", get_webapi_origin)
|
220
220
|
fs_files = partial(client.fs_files, **request_kwargs)
|
221
221
|
elif app == "open":
|
222
|
-
fs_files = partial(client.fs_files_open, **request_kwargs)
|
222
|
+
fs_files = partial(client.fs_files_open, **request_kwargs)
|
223
223
|
else:
|
224
224
|
request_kwargs.setdefault("base_url", get_proapi_origin)
|
225
225
|
fs_files = partial(client.fs_files_app, app=app, **request_kwargs)
|
@@ -336,7 +336,7 @@ async def iter_fs_files_asynchronized(
|
|
336
336
|
request_kwargs.setdefault("base_url", get_webapi_origin)
|
337
337
|
fs_files = partial(client.fs_files, **request_kwargs)
|
338
338
|
elif app == "open":
|
339
|
-
fs_files = partial(client.fs_files_open, **request_kwargs)
|
339
|
+
fs_files = partial(client.fs_files_open, **request_kwargs)
|
340
340
|
else:
|
341
341
|
request_kwargs.setdefault("base_url", get_proapi_origin)
|
342
342
|
fs_files = partial(client.fs_files_app, app=app, **request_kwargs)
|
@@ -377,7 +377,7 @@ async def iter_fs_files_asynchronized(
|
|
377
377
|
if args is None:
|
378
378
|
args = copy(payload)
|
379
379
|
ts = time()
|
380
|
-
return create_task(get_files(args))
|
380
|
+
return create_task(get_files(args))
|
381
381
|
task = make_task()
|
382
382
|
offset = payload["offset"]
|
383
383
|
while True:
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|