p115client 0.0.5.10.9__py3-none-any.whl → 0.0.5.11.1__py3-none-any.whl
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/_upload.py +8 -8
- p115client/client.py +963 -256
- p115client/tool/attr.py +1 -1
- p115client/tool/download.py +86 -69
- p115client/tool/edit.py +3 -3
- p115client/tool/export_dir.py +22 -23
- p115client/tool/fs_files.py +4 -7
- p115client/tool/history.py +5 -5
- p115client/tool/iterdir.py +87 -88
- p115client/tool/life.py +12 -12
- p115client/tool/pool.py +5 -5
- p115client/tool/upload.py +4 -4
- p115client/tool/xys.py +10 -7
- {p115client-0.0.5.10.9.dist-info → p115client-0.0.5.11.1.dist-info}/METADATA +2 -2
- p115client-0.0.5.11.1.dist-info/RECORD +26 -0
- p115client-0.0.5.10.9.dist-info/RECORD +0 -26
- {p115client-0.0.5.10.9.dist-info → p115client-0.0.5.11.1.dist-info}/LICENSE +0 -0
- {p115client-0.0.5.10.9.dist-info → p115client-0.0.5.11.1.dist-info}/WHEEL +0 -0
p115client/tool/pool.py
CHANGED
@@ -88,7 +88,7 @@ def generate_auth_factory(
|
|
88
88
|
"authorization": "Bearer " + resp["data"]["access_token"],
|
89
89
|
"app_id": str(app_id),
|
90
90
|
}
|
91
|
-
return run_gen_step(gen_step, async_=async_)
|
91
|
+
return run_gen_step(gen_step, simple=True, async_=async_)
|
92
92
|
return make_cookies
|
93
93
|
|
94
94
|
|
@@ -142,7 +142,7 @@ def generate_cookies_factory(
|
|
142
142
|
"cookie": "; ".join(f"{k}={v}" for k, v in resp["data"]["cookie"].items()),
|
143
143
|
"app": app,
|
144
144
|
}
|
145
|
-
return run_gen_step(gen_step, async_=async_)
|
145
|
+
return run_gen_step(gen_step, simple=True, async_=async_)
|
146
146
|
return make_cookies
|
147
147
|
|
148
148
|
|
@@ -165,7 +165,7 @@ def generate_client_factory(
|
|
165
165
|
def gen_step():
|
166
166
|
headers = yield call(async_=async_)
|
167
167
|
return cls(headers["cookie"])
|
168
|
-
return run_gen_step(gen_step, async_=async_)
|
168
|
+
return run_gen_step(gen_step, simple=True, async_=async_)
|
169
169
|
return make_client
|
170
170
|
|
171
171
|
|
@@ -215,7 +215,7 @@ def make_pool[T](
|
|
215
215
|
value = generate()
|
216
216
|
val = ComparedWithID(value)
|
217
217
|
return value, partial(heappush, heap_, (time(), val))
|
218
|
-
return run_gen_step(call, async_=async_)
|
218
|
+
return run_gen_step(call, simple=True, async_=async_)
|
219
219
|
if not lock:
|
220
220
|
setattr(get_value, "heap", heap_)
|
221
221
|
return get_value
|
@@ -377,7 +377,7 @@ def call_wrap_with_pool(get_cert_headers: Callable, /, func: Callable) -> Callab
|
|
377
377
|
if not isinstance(e, (AuthenticationError, LoginError)) and get_status_code(e) != 405:
|
378
378
|
revert()
|
379
379
|
raise
|
380
|
-
return run_gen_step(gen_step, async_=async_)
|
380
|
+
return run_gen_step(gen_step, simple=True, async_=async_)
|
381
381
|
return update_wrapper(wrapper, func)
|
382
382
|
|
383
383
|
|
p115client/tool/upload.py
CHANGED
@@ -348,7 +348,7 @@ def iter_115_to_115_resume(
|
|
348
348
|
**request_kwargs,
|
349
349
|
)) as get_next:
|
350
350
|
while True:
|
351
|
-
attr = yield get_next
|
351
|
+
attr = yield get_next()
|
352
352
|
if attr["name"] == name:
|
353
353
|
to_cid = attr["id"]
|
354
354
|
break
|
@@ -418,12 +418,12 @@ def iter_115_to_115_resume(
|
|
418
418
|
if async_:
|
419
419
|
return YieldFrom(
|
420
420
|
taskgroup_map(upload, from_files, arg_func=get_pid, max_workers=max_workers),
|
421
|
-
|
421
|
+
may_await=False,
|
422
422
|
)
|
423
423
|
else:
|
424
424
|
return YieldFrom(
|
425
425
|
threadpool_map(upload, from_files, arg_func=get_pid, max_workers=max_workers),
|
426
|
-
|
426
|
+
may_await=False,
|
427
427
|
)
|
428
|
-
return run_gen_step_iter(gen_step, async_=async_)
|
428
|
+
return run_gen_step_iter(gen_step, simple=True, async_=async_)
|
429
429
|
|
p115client/tool/xys.py
CHANGED
@@ -59,7 +59,7 @@ def wish_info(
|
|
59
59
|
)
|
60
60
|
check_response(resp)
|
61
61
|
return resp["data"]
|
62
|
-
return run_gen_step(gen_step, async_=async_)
|
62
|
+
return run_gen_step(gen_step, simple=True, async_=async_)
|
63
63
|
|
64
64
|
|
65
65
|
@overload
|
@@ -110,7 +110,7 @@ def wish_make(
|
|
110
110
|
)
|
111
111
|
check_response(resp)
|
112
112
|
return P115StrID(resp["data"]["xys_id"], resp["data"])
|
113
|
-
return run_gen_step(gen_step, async_=async_)
|
113
|
+
return run_gen_step(gen_step, simple=True, async_=async_)
|
114
114
|
|
115
115
|
|
116
116
|
@overload
|
@@ -146,6 +146,9 @@ def wish_answer(
|
|
146
146
|
) -> P115StrID | Coroutine[Any, Any, P115StrID]:
|
147
147
|
"""许愿树活动:创建助愿(助愿创建后需要等审核)
|
148
148
|
|
149
|
+
.. note::
|
150
|
+
如果从未调用过 `wish_info(client, wish_id)`,请先调用,否则会报参数错误
|
151
|
+
|
149
152
|
:param client: 115 客户端或 cookies
|
150
153
|
:param wish_id: 许愿 id
|
151
154
|
:param content: 助愿内容
|
@@ -167,7 +170,7 @@ def wish_answer(
|
|
167
170
|
)
|
168
171
|
check_response(resp)
|
169
172
|
return P115StrID(resp["data"]["aid_id"], resp["data"])
|
170
|
-
return run_gen_step(gen_step, async_=async_)
|
173
|
+
return run_gen_step(gen_step, simple=True, async_=async_)
|
171
174
|
|
172
175
|
|
173
176
|
@overload
|
@@ -323,11 +326,11 @@ def wish_iter(
|
|
323
326
|
)
|
324
327
|
check_response(resp)
|
325
328
|
ls = resp["data"]["list"]
|
326
|
-
yield YieldFrom(ls,
|
329
|
+
yield YieldFrom(ls, may_await=False)
|
327
330
|
if not ls:
|
328
331
|
break
|
329
332
|
payload["page"] += 1
|
330
|
-
return run_gen_step_iter(gen_step, async_=async_)
|
333
|
+
return run_gen_step_iter(gen_step, simple=True, async_=async_)
|
331
334
|
|
332
335
|
|
333
336
|
@overload
|
@@ -382,11 +385,11 @@ def wish_aid_iter(
|
|
382
385
|
)
|
383
386
|
check_response(resp)
|
384
387
|
ls = resp["data"]["list"]
|
385
|
-
yield YieldFrom(ls,
|
388
|
+
yield YieldFrom(ls, may_await=False)
|
386
389
|
if not ls:
|
387
390
|
break
|
388
391
|
payload["page"] += 1
|
389
|
-
return run_gen_step_iter(gen_step, async_=async_)
|
392
|
+
return run_gen_step_iter(gen_step, simple=True, async_=async_)
|
390
393
|
|
391
394
|
|
392
395
|
# TODO: 再实现一个漂流瓶
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: p115client
|
3
|
-
Version: 0.0.5.
|
3
|
+
Version: 0.0.5.11.1
|
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.
|
43
|
+
Requires-Dist: python-iterutils (>=0.2)
|
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)
|
@@ -0,0 +1,26 @@
|
|
1
|
+
LICENSE,sha256=o5242_N2TgDsWwFhPn7yr8YJNF7XsJM5NxUMtcT97bc,1100
|
2
|
+
p115client/__init__.py,sha256=1mx7njuAlqcuEWONTjSiiGnXyyNyqOcJyNX1FMHqQ-4,214
|
3
|
+
p115client/_upload.py,sha256=mcg6BAJi49Mq_jE5ql3FUdUbIokLqT8WFgSnkQtQdxw,30762
|
4
|
+
p115client/client.py,sha256=Imc9m8Al9hj-Lq0AzO8bFzcn20ubnguqyCi4e9F_qFs,770852
|
5
|
+
p115client/const.py,sha256=Ks8eYjHYApxlkelVCbSJlpmlCYtbk8fX80jETV72BTY,7754
|
6
|
+
p115client/exception.py,sha256=O4SlfjbtI9GPjzbzJrFaFUZENJFz2qA3VDEKZfdhHbc,3590
|
7
|
+
p115client/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
|
+
p115client/tool/__init__.py,sha256=NjT9rroMhLwKI7UlpSCksSsnB3GexXzxvhfunNWzjY0,386
|
9
|
+
p115client/tool/attr.py,sha256=MoLSDaa53nlvkDQOgX1Nq7CaCeO3I4tTkR9oq62dBGI,2896
|
10
|
+
p115client/tool/download.py,sha256=7pJIkRx5M8GSeqiZFpvay0_MwZRsFizkU4nee9aLIBI,61666
|
11
|
+
p115client/tool/edit.py,sha256=F8FhtyBjXRQ7TroNTM8SMG3s9TmCRoDsHId2fGalxW4,17756
|
12
|
+
p115client/tool/export_dir.py,sha256=om2b6At1jnaBD0Qw5TeEfD7wJlSL5PC2JGtJDN4Vh9U,24603
|
13
|
+
p115client/tool/fs_files.py,sha256=uo_2x8Nq1KTagNl2YdM8jRzp97pg513OVo280BK74xU,15645
|
14
|
+
p115client/tool/history.py,sha256=2i6k5Wvo7IVaUO0GDT5nHNV5qQFk_Q_1qY2ZF2MxLsE,7490
|
15
|
+
p115client/tool/iterdir.py,sha256=idSTl7lKbCewhfgMQMyMRE5sx3Pxn_Y2V5_95yoS6JE,200191
|
16
|
+
p115client/tool/life.py,sha256=C2n4nvf5xUc8KGl2R0yatWc-5CmwgkONOX1pxUP5ZSQ,17391
|
17
|
+
p115client/tool/pool.py,sha256=EO_dmtcGBWCnbWqgoaGMsJGhIaCUQ-rdc5qC-oaseq8,14018
|
18
|
+
p115client/tool/request.py,sha256=rjXuQwRganE5Z-4rfgnyPFjE4jzdQSLdIs9s0cIDshU,7043
|
19
|
+
p115client/tool/upload.py,sha256=qzXgMXf8MfeZIQbylVeh77o_ItKI7kMaIgwuppprfeM,15934
|
20
|
+
p115client/tool/util.py,sha256=0o9TrXdoPcljgxDDRdxRon41bq1OjuUYCWsR0XLfmPo,3357
|
21
|
+
p115client/tool/xys.py,sha256=NVwXXB1ZvFKQKcar1kQdDzlUN7xilGheO_eEeoMxjMw,10325
|
22
|
+
p115client/type.py,sha256=7kOp98uLaYqcTTCgCrb3DRcl8ukMpn7ibsnVvtw2nG8,6250
|
23
|
+
p115client-0.0.5.11.1.dist-info/LICENSE,sha256=o5242_N2TgDsWwFhPn7yr8YJNF7XsJM5NxUMtcT97bc,1100
|
24
|
+
p115client-0.0.5.11.1.dist-info/METADATA,sha256=kfxL11eFcfcyYXqowRiAtQGFbzoPTWYW_Ecx6_hd7Bg,8238
|
25
|
+
p115client-0.0.5.11.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
26
|
+
p115client-0.0.5.11.1.dist-info/RECORD,,
|
@@ -1,26 +0,0 @@
|
|
1
|
-
LICENSE,sha256=o5242_N2TgDsWwFhPn7yr8YJNF7XsJM5NxUMtcT97bc,1100
|
2
|
-
p115client/__init__.py,sha256=1mx7njuAlqcuEWONTjSiiGnXyyNyqOcJyNX1FMHqQ-4,214
|
3
|
-
p115client/_upload.py,sha256=DOckFLU_P7Fl0BNu_0-2od6pPsCnzroYY6zZE5_EMnM,30735
|
4
|
-
p115client/client.py,sha256=OV6XeA36L8PxpHB-27hhpz_Zv_XMAuMR2GuNDNuy6uo,749032
|
5
|
-
p115client/const.py,sha256=Ks8eYjHYApxlkelVCbSJlpmlCYtbk8fX80jETV72BTY,7754
|
6
|
-
p115client/exception.py,sha256=O4SlfjbtI9GPjzbzJrFaFUZENJFz2qA3VDEKZfdhHbc,3590
|
7
|
-
p115client/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
|
-
p115client/tool/__init__.py,sha256=NjT9rroMhLwKI7UlpSCksSsnB3GexXzxvhfunNWzjY0,386
|
9
|
-
p115client/tool/attr.py,sha256=9xN99lgFxE-48nqiIOSuuo3R0D9lcvuJvcRbJzPKKiw,2883
|
10
|
-
p115client/tool/download.py,sha256=3zoxkLPf4Jya-wYowZJmZR65sR3GWNWNmnevKrrgvQY,60509
|
11
|
-
p115client/tool/edit.py,sha256=eRlR1UZMpfGnoetpqSAAx5bPBOEiSlx7HPkpOSs5agk,17739
|
12
|
-
p115client/tool/export_dir.py,sha256=iMnKtnESi8HKvW9WhIvOdEoMXSBpAnhFlGeyKXHpQbE,24545
|
13
|
-
p115client/tool/fs_files.py,sha256=jY57L4nhB9t-2kT_1j3mdiwOdPZKsimN3eN5mUJAqMI,15745
|
14
|
-
p115client/tool/history.py,sha256=2S26BH7uBNfVHlbYFNy-aNOLMcM-HrlR7TLHAZacUJI,7458
|
15
|
-
p115client/tool/iterdir.py,sha256=ei1VddAc96DD0QSSZm7c3ivcCjiP_y6tuSJr5zcpqvg,199695
|
16
|
-
p115client/tool/life.py,sha256=X6Bp0GYKwnZeWlttE2DIVw5iOCXM5QzIkM6Zuj24c5Y,17323
|
17
|
-
p115client/tool/pool.py,sha256=K-ALC-JEwik3DYCr5Eckok15oQnHRe6yznKIuJ9jyyM,13953
|
18
|
-
p115client/tool/request.py,sha256=rjXuQwRganE5Z-4rfgnyPFjE4jzdQSLdIs9s0cIDshU,7043
|
19
|
-
p115client/tool/upload.py,sha256=qK1OQYxP-Faq2eMDhc5sBXJiSr8m8EZ_gb0O_iA2TrI,15915
|
20
|
-
p115client/tool/util.py,sha256=0o9TrXdoPcljgxDDRdxRon41bq1OjuUYCWsR0XLfmPo,3357
|
21
|
-
p115client/tool/xys.py,sha256=WMTisCyN4eYyv4A14yYOpjud2mBhQvBcUHOp6pJUQeA,10140
|
22
|
-
p115client/type.py,sha256=7kOp98uLaYqcTTCgCrb3DRcl8ukMpn7ibsnVvtw2nG8,6250
|
23
|
-
p115client-0.0.5.10.9.dist-info/LICENSE,sha256=o5242_N2TgDsWwFhPn7yr8YJNF7XsJM5NxUMtcT97bc,1100
|
24
|
-
p115client-0.0.5.10.9.dist-info/METADATA,sha256=Ih2qnVhmpJ4wtSYYLN-tU0LK4l4idH5uT9lnUzHUXRk,8241
|
25
|
-
p115client-0.0.5.10.9.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
26
|
-
p115client-0.0.5.10.9.dist-info/RECORD,,
|
File without changes
|
File without changes
|