p115client 0.0.5.7__py3-none-any.whl → 0.0.5.8.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/client.py +352 -83
- {p115client-0.0.5.7.dist-info → p115client-0.0.5.8.1.dist-info}/METADATA +2 -2
- {p115client-0.0.5.7.dist-info → p115client-0.0.5.8.1.dist-info}/RECORD +5 -5
- {p115client-0.0.5.7.dist-info → p115client-0.0.5.8.1.dist-info}/LICENSE +0 -0
- {p115client-0.0.5.7.dist-info → p115client-0.0.5.8.1.dist-info}/WHEEL +0 -0
p115client/client.py
CHANGED
@@ -3976,51 +3976,6 @@ class P115OpenClient(ClientRequestMixin):
|
|
3976
3976
|
)
|
3977
3977
|
return run_gen_step(gen_step, async_=async_)
|
3978
3978
|
|
3979
|
-
@overload
|
3980
|
-
def vip_qr_url(
|
3981
|
-
self,
|
3982
|
-
payload: dict,
|
3983
|
-
/,
|
3984
|
-
base_url: bool | str | Callable[[], str] = False,
|
3985
|
-
*,
|
3986
|
-
async_: Literal[False] = False,
|
3987
|
-
**request_kwargs,
|
3988
|
-
) -> dict:
|
3989
|
-
...
|
3990
|
-
@overload
|
3991
|
-
def vip_qr_url(
|
3992
|
-
self,
|
3993
|
-
payload: dict,
|
3994
|
-
/,
|
3995
|
-
base_url: bool | str | Callable[[], str] = False,
|
3996
|
-
*,
|
3997
|
-
async_: Literal[True],
|
3998
|
-
**request_kwargs,
|
3999
|
-
) -> Coroutine[Any, Any, dict]:
|
4000
|
-
...
|
4001
|
-
def vip_qr_url(
|
4002
|
-
self,
|
4003
|
-
payload: dict,
|
4004
|
-
/,
|
4005
|
-
base_url: bool | str | Callable[[], str] = False,
|
4006
|
-
*,
|
4007
|
-
async_: Literal[False, True] = False,
|
4008
|
-
**request_kwargs,
|
4009
|
-
) -> dict | Coroutine[Any, Any, dict]:
|
4010
|
-
"""获取开放平台产品列表
|
4011
|
-
|
4012
|
-
GET https://proapi.115.com/open/vip/qr_url
|
4013
|
-
|
4014
|
-
.. note::
|
4015
|
-
https://www.yuque.com/115yun/open/yifbvxan6szytyng
|
4016
|
-
|
4017
|
-
:payload:
|
4018
|
-
- open_device: int | str 💡 设备号
|
4019
|
-
- default_product_id: int | str 💡 默认产品ID
|
4020
|
-
"""
|
4021
|
-
api = complete_proapi("/open/vip/qr_url", base_url)
|
4022
|
-
return self.request(url=api, params=payload, async_=async_, **request_kwargs)
|
4023
|
-
|
4024
3979
|
download_url_open = download_url
|
4025
3980
|
download_url_info_open = download_url_info
|
4026
3981
|
fs_copy_open = fs_copy
|
@@ -4040,7 +3995,6 @@ class P115OpenClient(ClientRequestMixin):
|
|
4040
3995
|
user_info_open = user_info
|
4041
3996
|
upload_file_init_open = upload_file_init
|
4042
3997
|
upload_file_open = upload_file
|
4043
|
-
vip_qr_url_open = vip_qr_url
|
4044
3998
|
|
4045
3999
|
|
4046
4000
|
class P115Client(P115OpenClient):
|
@@ -17251,9 +17205,9 @@ class P115Client(P115OpenClient):
|
|
17251
17205
|
return P115URL(
|
17252
17206
|
url["url"] if url else "",
|
17253
17207
|
id=int(info["fid"]),
|
17254
|
-
sha1=info.get("sha1", ""),
|
17255
17208
|
name=info["fn"],
|
17256
17209
|
size=int(info["fs"]),
|
17210
|
+
sha1=info.get("sha1", ""),
|
17257
17211
|
is_directory=not url,
|
17258
17212
|
)
|
17259
17213
|
if async_:
|
@@ -17585,11 +17539,11 @@ class P115Client(P115OpenClient):
|
|
17585
17539
|
:payload:
|
17586
17540
|
- share_code: str
|
17587
17541
|
- receive_code: str
|
17588
|
-
- file_id: int | str
|
17589
|
-
- cid: int | str = <default>
|
17542
|
+
- file_id: int | str 💡 有多个时,用逗号 "," 分隔
|
17543
|
+
- cid: int | str = <default> 💡 这是你网盘的目录 cid
|
17544
|
+
- is_check: 0 | 1 = <default>
|
17590
17545
|
"""
|
17591
17546
|
api = complete_webapi("/share/receive", base_url=base_url)
|
17592
|
-
payload = {"cid": 0, **payload}
|
17593
17547
|
return self.request(url=api, method="POST", data=payload, async_=async_, **request_kwargs)
|
17594
17548
|
|
17595
17549
|
@overload
|
@@ -17633,11 +17587,11 @@ class P115Client(P115OpenClient):
|
|
17633
17587
|
:payload:
|
17634
17588
|
- share_code: str
|
17635
17589
|
- receive_code: str
|
17636
|
-
- file_id: int | str
|
17637
|
-
- cid: int | str = <default>
|
17590
|
+
- file_id: int | str 💡 有多个时,用逗号 "," 分隔
|
17591
|
+
- cid: int | str = <default> 💡 这是你网盘的目录 cid
|
17592
|
+
- is_check: 0 | 1 = <default>
|
17638
17593
|
"""
|
17639
17594
|
api = complete_proapi("/2.0/share/receive", base_url, app)
|
17640
|
-
payload = {"cid": 0, **payload}
|
17641
17595
|
return self.request(url=api, method="POST", data=payload, async_=async_, **request_kwargs)
|
17642
17596
|
|
17643
17597
|
@overload
|
@@ -17793,7 +17747,7 @@ class P115Client(P115OpenClient):
|
|
17793
17747
|
.. attention::
|
17794
17748
|
最多只能取回前 10,000 条数据,也就是 limit + offset <= 10_000
|
17795
17749
|
|
17796
|
-
:
|
17750
|
+
:payload:
|
17797
17751
|
- share_code: str 💡 分享码
|
17798
17752
|
- receive_code: str 💡 接收码(即密码)
|
17799
17753
|
- cid: int | str = 0 💡 目录 id
|
@@ -17817,6 +17771,50 @@ class P115Client(P115OpenClient):
|
|
17817
17771
|
payload = {"cid": 0, "limit": 32, "offset": 0, "search_value": ".", **payload}
|
17818
17772
|
return self.request(url=api, params=payload, async_=async_, **request_kwargs)
|
17819
17773
|
|
17774
|
+
@overload
|
17775
|
+
def share_skip_login_check(
|
17776
|
+
self,
|
17777
|
+
payload: dict,
|
17778
|
+
/,
|
17779
|
+
base_url: bool | str | Callable[[], str] = False,
|
17780
|
+
*,
|
17781
|
+
async_: Literal[False] = False,
|
17782
|
+
**request_kwargs,
|
17783
|
+
) -> dict:
|
17784
|
+
...
|
17785
|
+
@overload
|
17786
|
+
def share_skip_login_check(
|
17787
|
+
self,
|
17788
|
+
payload: dict,
|
17789
|
+
/,
|
17790
|
+
base_url: bool | str | Callable[[], str] = False,
|
17791
|
+
*,
|
17792
|
+
async_: Literal[True],
|
17793
|
+
**request_kwargs,
|
17794
|
+
) -> Coroutine[Any, Any, dict]:
|
17795
|
+
...
|
17796
|
+
def share_skip_login_check(
|
17797
|
+
self,
|
17798
|
+
payload: dict,
|
17799
|
+
/,
|
17800
|
+
base_url: bool | str | Callable[[], str] = False,
|
17801
|
+
*,
|
17802
|
+
async_: Literal[False, True] = False,
|
17803
|
+
**request_kwargs,
|
17804
|
+
) -> dict | Coroutine[Any, Any, dict]:
|
17805
|
+
"""检查是否可免登录下载
|
17806
|
+
|
17807
|
+
POST https://webapi.115.com/share/is_skip_login
|
17808
|
+
|
17809
|
+
:payload:
|
17810
|
+
- share_code: str 💡 分享码
|
17811
|
+
- receive_code: str 💡 接收码(访问密码)
|
17812
|
+
- file_id: int | str = 1 💡 文件 id(可以随便填一个非 0 的值)
|
17813
|
+
"""
|
17814
|
+
api = complete_webapi("/share/is_skip_login", base_url=base_url)
|
17815
|
+
payload.setdefault("file_id", 1)
|
17816
|
+
return self.request(url=api, method="POST", data=payload, async_=async_, **request_kwargs)
|
17817
|
+
|
17820
17818
|
@overload
|
17821
17819
|
def share_skip_login_down(
|
17822
17820
|
self,
|
@@ -17852,7 +17850,7 @@ class P115Client(P115OpenClient):
|
|
17852
17850
|
|
17853
17851
|
POST https://webapi.115.com/share/skip_login_down
|
17854
17852
|
|
17855
|
-
:
|
17853
|
+
:payload:
|
17856
17854
|
- share_code: str 💡 分享码
|
17857
17855
|
- skip_login: 0 | 1 = 1 💡 是否开启
|
17858
17856
|
"""
|
@@ -17863,6 +17861,248 @@ class P115Client(P115OpenClient):
|
|
17863
17861
|
payload = {"skip_login": 1, **payload}
|
17864
17862
|
return self.request(url=api, method="POST", data=payload, async_=async_, **request_kwargs)
|
17865
17863
|
|
17864
|
+
@overload
|
17865
|
+
def share_skip_login_download_url(
|
17866
|
+
self,
|
17867
|
+
payload: int | str | dict,
|
17868
|
+
/,
|
17869
|
+
url: str = "",
|
17870
|
+
strict: bool = True,
|
17871
|
+
use_web_api: bool = False,
|
17872
|
+
app: str = "",
|
17873
|
+
*,
|
17874
|
+
async_: Literal[False] = False,
|
17875
|
+
**request_kwargs,
|
17876
|
+
) -> P115URL:
|
17877
|
+
...
|
17878
|
+
@overload
|
17879
|
+
def share_skip_login_download_url(
|
17880
|
+
self,
|
17881
|
+
payload: int | str | dict,
|
17882
|
+
/,
|
17883
|
+
url: str = "",
|
17884
|
+
strict: bool = True,
|
17885
|
+
use_web_api: bool = False,
|
17886
|
+
app: str = "",
|
17887
|
+
*,
|
17888
|
+
async_: Literal[True],
|
17889
|
+
**request_kwargs,
|
17890
|
+
) -> Coroutine[Any, Any, P115URL]:
|
17891
|
+
...
|
17892
|
+
def share_skip_login_download_url(
|
17893
|
+
self,
|
17894
|
+
payload: int | str | dict,
|
17895
|
+
/,
|
17896
|
+
url: str = "",
|
17897
|
+
strict: bool = True,
|
17898
|
+
use_web_api: bool = False,
|
17899
|
+
app: str = "",
|
17900
|
+
*,
|
17901
|
+
async_: Literal[False, True] = False,
|
17902
|
+
**request_kwargs,
|
17903
|
+
) -> P115URL | Coroutine[Any, Any, P115URL]:
|
17904
|
+
"""获取分享链接中某个文件的下载链接
|
17905
|
+
|
17906
|
+
:param payload: 请求参数,如果为 int 或 str,则视为 `file_id`
|
17907
|
+
|
17908
|
+
- file_id: int | str 💡 文件 id
|
17909
|
+
- receive_code: str 💡 接收码(访问密码)
|
17910
|
+
- share_code: str 💡 分享码
|
17911
|
+
|
17912
|
+
:param url: 分享链接,如果提供的话,会被拆解并合并到 `payload` 中,优先级较高
|
17913
|
+
:param strict: 如果为 True,当目标是目录时,会抛出 IsADirectoryError 异常
|
17914
|
+
:param use_web_api: 是否使用网页版接口执行请求(优先级高于 `app`)
|
17915
|
+
:param app: 使用此设备的接口
|
17916
|
+
:param async_: 是否异步
|
17917
|
+
:param request_kwargs: 其它请求参数
|
17918
|
+
|
17919
|
+
:return: 下载链接
|
17920
|
+
"""
|
17921
|
+
if isinstance(payload, (int, str)):
|
17922
|
+
payload = {"file_id": payload}
|
17923
|
+
else:
|
17924
|
+
payload = dict(payload)
|
17925
|
+
if url:
|
17926
|
+
from .tool import share_extract_payload
|
17927
|
+
share_payload = share_extract_payload(url)
|
17928
|
+
payload["share_code"] = share_payload["share_code"]
|
17929
|
+
payload["receive_code"] = share_payload["receive_code"] or ""
|
17930
|
+
if use_web_api:
|
17931
|
+
resp = self.share_skip_login_download_url_web(payload, async_=async_, **request_kwargs)
|
17932
|
+
else:
|
17933
|
+
resp = self.share_skip_login_download_url_app(payload, app=app, async_=async_, **request_kwargs)
|
17934
|
+
def get_url(resp: dict, /) -> P115URL:
|
17935
|
+
info = check_response(resp)["data"]
|
17936
|
+
file_id = payload["file_id"]
|
17937
|
+
if not info:
|
17938
|
+
raise FileNotFoundError(
|
17939
|
+
errno.ENOENT,
|
17940
|
+
f"no such id: {file_id!r}, with response {resp}",
|
17941
|
+
)
|
17942
|
+
url = info["url"]
|
17943
|
+
if strict and not url:
|
17944
|
+
raise IsADirectoryError(
|
17945
|
+
errno.EISDIR,
|
17946
|
+
f"{file_id} is a directory, with response {resp}",
|
17947
|
+
)
|
17948
|
+
return P115URL(
|
17949
|
+
url["url"] if url else "",
|
17950
|
+
id=int(info["fid"]),
|
17951
|
+
name=info["fn"],
|
17952
|
+
size=int(info["fs"]),
|
17953
|
+
sha1=info.get("sha1", ""),
|
17954
|
+
is_directory=not url,
|
17955
|
+
)
|
17956
|
+
if async_:
|
17957
|
+
async def async_request() -> P115URL:
|
17958
|
+
return get_url(await cast(Coroutine[Any, Any, dict], resp))
|
17959
|
+
return async_request()
|
17960
|
+
else:
|
17961
|
+
return get_url(cast(dict, resp))
|
17962
|
+
|
17963
|
+
@overload
|
17964
|
+
def share_skip_login_download_url_app(
|
17965
|
+
self,
|
17966
|
+
payload: dict,
|
17967
|
+
/,
|
17968
|
+
app: str = "",
|
17969
|
+
base_url: bool | str | Callable[[], str] = False,
|
17970
|
+
*,
|
17971
|
+
async_: Literal[False] = False,
|
17972
|
+
**request_kwargs,
|
17973
|
+
) -> dict:
|
17974
|
+
...
|
17975
|
+
@overload
|
17976
|
+
def share_skip_login_download_url_app(
|
17977
|
+
self,
|
17978
|
+
payload: dict,
|
17979
|
+
/,
|
17980
|
+
app: str = "",
|
17981
|
+
base_url: bool | str | Callable[[], str] = False,
|
17982
|
+
*,
|
17983
|
+
async_: Literal[True],
|
17984
|
+
**request_kwargs,
|
17985
|
+
) -> Coroutine[Any, Any, dict]:
|
17986
|
+
...
|
17987
|
+
def share_skip_login_download_url_app(
|
17988
|
+
self,
|
17989
|
+
payload: dict,
|
17990
|
+
/,
|
17991
|
+
app: str = "",
|
17992
|
+
base_url: bool | str | Callable[[], str] = False,
|
17993
|
+
*,
|
17994
|
+
async_: Literal[False, True] = False,
|
17995
|
+
**request_kwargs,
|
17996
|
+
) -> dict | Coroutine[Any, Any, dict]:
|
17997
|
+
"""获取免登录下载链接
|
17998
|
+
|
17999
|
+
POST https://proapi.115.com/app/share/skip_login_downurl
|
18000
|
+
|
18001
|
+
:payload:
|
18002
|
+
- file_id: int | str
|
18003
|
+
- receive_code: str
|
18004
|
+
- share_code: str
|
18005
|
+
"""
|
18006
|
+
if app:
|
18007
|
+
api = complete_proapi("/2.0/share/skip_login_downurl", base_url, app)
|
18008
|
+
return self.request(url=api, method="POST", data=payload, async_=async_, **request_kwargs)
|
18009
|
+
else:
|
18010
|
+
api = complete_proapi("/app/share/skip_login_downurl", base_url)
|
18011
|
+
def parse(resp, content: bytes, /) -> dict:
|
18012
|
+
resp = json_loads(content)
|
18013
|
+
if resp["state"]:
|
18014
|
+
resp["data"] = json_loads(rsa_decode(resp["data"]))
|
18015
|
+
return resp
|
18016
|
+
request_kwargs.setdefault("parse", parse)
|
18017
|
+
payload = {"data": rsa_encode(dumps(payload)).decode()}
|
18018
|
+
return self.request(url=api, method="POST", data=payload, async_=async_, **request_kwargs)
|
18019
|
+
|
18020
|
+
@overload
|
18021
|
+
def share_skip_login_download_url_web(
|
18022
|
+
self,
|
18023
|
+
payload: dict,
|
18024
|
+
/,
|
18025
|
+
base_url: bool | str | Callable[[], str] = False,
|
18026
|
+
*,
|
18027
|
+
async_: Literal[False] = False,
|
18028
|
+
**request_kwargs,
|
18029
|
+
) -> dict:
|
18030
|
+
...
|
18031
|
+
@overload
|
18032
|
+
def share_skip_login_download_url_web(
|
18033
|
+
self,
|
18034
|
+
payload: dict,
|
18035
|
+
/,
|
18036
|
+
base_url: bool | str | Callable[[], str] = False,
|
18037
|
+
*,
|
18038
|
+
async_: Literal[True],
|
18039
|
+
**request_kwargs,
|
18040
|
+
) -> Coroutine[Any, Any, dict]:
|
18041
|
+
...
|
18042
|
+
def share_skip_login_download_url_web(
|
18043
|
+
self,
|
18044
|
+
payload: dict,
|
18045
|
+
/,
|
18046
|
+
base_url: bool | str | Callable[[], str] = False,
|
18047
|
+
*,
|
18048
|
+
async_: Literal[False, True] = False,
|
18049
|
+
**request_kwargs,
|
18050
|
+
) -> dict | Coroutine[Any, Any, dict]:
|
18051
|
+
"""获取免登录下载链接
|
18052
|
+
|
18053
|
+
POST https://webapi.115.com/share/skip_login_downurl
|
18054
|
+
|
18055
|
+
:payload:
|
18056
|
+
- share_code: str 💡 分享码
|
18057
|
+
- receive_code: str 💡 接收码(访问密码)
|
18058
|
+
- file_id: int | str 💡 文件 id
|
18059
|
+
"""
|
18060
|
+
api = complete_webapi("/share/skip_login_downurl", base_url=base_url)
|
18061
|
+
return self.request(url=api, method="POST", data=payload, async_=async_, **request_kwargs)
|
18062
|
+
|
18063
|
+
@overload
|
18064
|
+
def share_skip_login_down_first(
|
18065
|
+
self,
|
18066
|
+
payload: str | dict,
|
18067
|
+
/,
|
18068
|
+
base_url: bool | str | Callable[[], str] = False,
|
18069
|
+
*,
|
18070
|
+
async_: Literal[False] = False,
|
18071
|
+
**request_kwargs,
|
18072
|
+
) -> dict:
|
18073
|
+
...
|
18074
|
+
@overload
|
18075
|
+
def share_skip_login_down_first(
|
18076
|
+
self,
|
18077
|
+
payload: str | dict,
|
18078
|
+
/,
|
18079
|
+
base_url: bool | str | Callable[[], str] = False,
|
18080
|
+
*,
|
18081
|
+
async_: Literal[True],
|
18082
|
+
**request_kwargs,
|
18083
|
+
) -> Coroutine[Any, Any, dict]:
|
18084
|
+
...
|
18085
|
+
def share_skip_login_down_first(
|
18086
|
+
self,
|
18087
|
+
payload: str | dict,
|
18088
|
+
/,
|
18089
|
+
base_url: bool | str | Callable[[], str] = False,
|
18090
|
+
*,
|
18091
|
+
async_: Literal[False, True] = False,
|
18092
|
+
**request_kwargs,
|
18093
|
+
) -> dict | Coroutine[Any, Any, dict]:
|
18094
|
+
"""免登录下载信息
|
18095
|
+
|
18096
|
+
GET https://webapi.115.com/share/skip_login_down_first
|
18097
|
+
|
18098
|
+
:payload:
|
18099
|
+
- share_code: str 💡 分享码
|
18100
|
+
"""
|
18101
|
+
api = complete_webapi("/share/skip_login_down_first", base_url=base_url)
|
18102
|
+
if isinstance(payload, str):
|
18103
|
+
payload = {"share_code": payload}
|
18104
|
+
return self.request(url=api, params=payload, async_=async_, **request_kwargs)
|
18105
|
+
|
17866
18106
|
@overload
|
17867
18107
|
def share_skip_login_down_details(
|
17868
18108
|
self,
|
@@ -17898,7 +18138,7 @@ class P115Client(P115OpenClient):
|
|
17898
18138
|
|
17899
18139
|
GET https://webapi.115.com/share/skip_login_down_details
|
17900
18140
|
|
17901
|
-
:
|
18141
|
+
:payload:
|
17902
18142
|
- start_time: str = <default> 💡 开始时间,格式为 "YYYY-MM-DD hh:mm:ss",默认为今天零点
|
17903
18143
|
- end_time: str = <default> 💡 结束时间(含),默认为明天零点
|
17904
18144
|
- share_code: str = "" 💡 分享码,如果为空则统计所有分享
|
@@ -17916,11 +18156,10 @@ class P115Client(P115OpenClient):
|
|
17916
18156
|
return self.request(url=api, params=payload, async_=async_, **request_kwargs)
|
17917
18157
|
|
17918
18158
|
@overload
|
17919
|
-
@staticmethod
|
17920
18159
|
def share_snap(
|
17921
|
-
|
18160
|
+
self: dict | P115Client,
|
18161
|
+
payload: None | dict = None,
|
17922
18162
|
/,
|
17923
|
-
request: None | Callable = None,
|
17924
18163
|
base_url: bool | str | Callable[[], str] = False,
|
17925
18164
|
*,
|
17926
18165
|
async_: Literal[False] = False,
|
@@ -17928,22 +18167,20 @@ class P115Client(P115OpenClient):
|
|
17928
18167
|
) -> dict:
|
17929
18168
|
...
|
17930
18169
|
@overload
|
17931
|
-
@staticmethod
|
17932
18170
|
def share_snap(
|
17933
|
-
|
18171
|
+
self: dict | P115Client,
|
18172
|
+
payload: None | dict = None,
|
17934
18173
|
/,
|
17935
|
-
request: None | Callable = None,
|
17936
18174
|
base_url: bool | str | Callable[[], str] = False,
|
17937
18175
|
*,
|
17938
18176
|
async_: Literal[True],
|
17939
18177
|
**request_kwargs,
|
17940
18178
|
) -> Coroutine[Any, Any, dict]:
|
17941
18179
|
...
|
17942
|
-
@staticmethod
|
17943
18180
|
def share_snap(
|
17944
|
-
|
18181
|
+
self: dict | P115Client,
|
18182
|
+
payload: None | dict = None,
|
17945
18183
|
/,
|
17946
|
-
request: None | Callable = None,
|
17947
18184
|
base_url: bool | str | Callable[[], str] = False,
|
17948
18185
|
*,
|
17949
18186
|
async_: Literal[False, True] = False,
|
@@ -17953,6 +18190,11 @@ class P115Client(P115OpenClient):
|
|
17953
18190
|
|
17954
18191
|
GET https://webapi.115.com/share/snap
|
17955
18192
|
|
18193
|
+
.. important::
|
18194
|
+
这个函数可以作为 staticmethod 使用,只要 `self` 为 dict 类型,此时不需要登录
|
18195
|
+
|
18196
|
+
否则,就是登录状态,但如果这个分享是你自己的,则可以不提供 receive_code,而且即使还在审核中,也能获取文件列表
|
18197
|
+
|
17956
18198
|
:payload:
|
17957
18199
|
- share_code: str
|
17958
18200
|
- receive_code: str
|
@@ -17967,17 +18209,25 @@ class P115Client(P115OpenClient):
|
|
17967
18209
|
- "user_ptime": 创建时间/修改时间
|
17968
18210
|
"""
|
17969
18211
|
api = complete_webapi("/share/snap", base_url=base_url)
|
18212
|
+
if isinstance(self, dict):
|
18213
|
+
payload = self
|
18214
|
+
else:
|
18215
|
+
assert payload is not None
|
17970
18216
|
payload = {"cid": 0, "limit": 32, "offset": 0, **payload}
|
17971
|
-
|
17972
|
-
|
17973
|
-
return get_default_request()(url=api, params=payload, async_=async_, **request_kwargs)
|
18217
|
+
if isinstance(self, P115Client):
|
18218
|
+
return self.request(url=api, params=payload, async_=async_, **request_kwargs)
|
17974
18219
|
else:
|
17975
|
-
|
18220
|
+
request_kwargs.setdefault("parse", default_parse)
|
18221
|
+
request = request_kwargs.pop("request", None)
|
18222
|
+
if request is None:
|
18223
|
+
return get_default_request()(url=api, params=payload, async_=async_, **request_kwargs)
|
18224
|
+
else:
|
18225
|
+
return request(url=api, params=payload, **request_kwargs)
|
17976
18226
|
|
17977
18227
|
@overload
|
17978
|
-
@staticmethod
|
17979
18228
|
def share_snap_app(
|
17980
|
-
|
18229
|
+
self: dict | P115Client,
|
18230
|
+
payload: None | dict = None,
|
17981
18231
|
/,
|
17982
18232
|
request: None | Callable = None,
|
17983
18233
|
app: str = "android",
|
@@ -17988,9 +18238,9 @@ class P115Client(P115OpenClient):
|
|
17988
18238
|
) -> dict:
|
17989
18239
|
...
|
17990
18240
|
@overload
|
17991
|
-
@staticmethod
|
17992
18241
|
def share_snap_app(
|
17993
|
-
|
18242
|
+
self: dict | P115Client,
|
18243
|
+
payload: None | dict = None,
|
17994
18244
|
/,
|
17995
18245
|
request: None | Callable = None,
|
17996
18246
|
app: str = "android",
|
@@ -18000,9 +18250,9 @@ class P115Client(P115OpenClient):
|
|
18000
18250
|
**request_kwargs,
|
18001
18251
|
) -> Coroutine[Any, Any, dict]:
|
18002
18252
|
...
|
18003
|
-
@staticmethod
|
18004
18253
|
def share_snap_app(
|
18005
|
-
|
18254
|
+
self: dict | P115Client,
|
18255
|
+
payload: None | dict = None,
|
18006
18256
|
/,
|
18007
18257
|
request: None | Callable = None,
|
18008
18258
|
app: str = "android",
|
@@ -18015,6 +18265,11 @@ class P115Client(P115OpenClient):
|
|
18015
18265
|
|
18016
18266
|
GET https://proapi.115.com/android/2.0/share/snap
|
18017
18267
|
|
18268
|
+
.. important::
|
18269
|
+
这个函数可以作为 staticmethod 使用,只要 `self` 为 dict 类型,此时不需要登录
|
18270
|
+
|
18271
|
+
否则,就是登录状态,但如果这个分享是你自己的,则可以不提供 receive_code,而且即使还在审核中,也能获取文件列表
|
18272
|
+
|
18018
18273
|
:payload:
|
18019
18274
|
- share_code: str
|
18020
18275
|
- receive_code: str
|
@@ -18029,12 +18284,20 @@ class P115Client(P115OpenClient):
|
|
18029
18284
|
- "user_ptime": 创建时间/修改时间
|
18030
18285
|
"""
|
18031
18286
|
api = complete_proapi("/2.0/share/snap", base_url, app)
|
18287
|
+
if isinstance(self, dict):
|
18288
|
+
payload = self
|
18289
|
+
else:
|
18290
|
+
assert payload is not None
|
18032
18291
|
payload = {"cid": 0, "limit": 32, "offset": 0, **payload}
|
18033
|
-
|
18034
|
-
|
18035
|
-
return get_default_request()(url=api, params=payload, async_=async_, **request_kwargs)
|
18292
|
+
if isinstance(self, P115Client):
|
18293
|
+
return self.request(url=api, params=payload, async_=async_, **request_kwargs)
|
18036
18294
|
else:
|
18037
|
-
|
18295
|
+
request_kwargs.setdefault("parse", default_parse)
|
18296
|
+
request = request_kwargs.pop("request", None)
|
18297
|
+
if request is None:
|
18298
|
+
return get_default_request()(url=api, params=payload, async_=async_, **request_kwargs)
|
18299
|
+
else:
|
18300
|
+
return request(url=api, params=payload, **request_kwargs)
|
18038
18301
|
|
18039
18302
|
@overload
|
18040
18303
|
def share_update(
|
@@ -18073,14 +18336,16 @@ class P115Client(P115OpenClient):
|
|
18073
18336
|
|
18074
18337
|
:payload:
|
18075
18338
|
- share_code: str
|
18076
|
-
- receive_code: str = <default> 💡
|
18077
|
-
- share_duration: int = <default> 💡 分享天数: 1(
|
18339
|
+
- receive_code: str = <default> 💡 接收码(访问密码)
|
18340
|
+
- share_duration: int = <default> 💡 分享天数: n(填入指定天数),-1(长期)
|
18078
18341
|
- is_custom_code: 0 | 1 = <default> 💡 用户自定义口令(不用管)
|
18079
18342
|
- auto_fill_recvcode: 0 | 1 = <default> 💡 分享链接自动填充口令(不用管)
|
18080
18343
|
- share_channel: int = <default> 💡 分享渠道代码(不用管)
|
18081
18344
|
- action: str = <default> 💡 操作: 取消分享 "cancel"
|
18082
18345
|
- skip_login_down_flow_limit: "" | int = <default> 💡 设置免登录下载限制流量,如果为 "" 则不限,单位: 字节
|
18083
18346
|
- access_user_ids = int | str = <default> 💡 设置访问账号,多个用逗号 "," 隔开
|
18347
|
+
- receive_user_limit: int = <default> 💡 接收次数
|
18348
|
+
- reset_receive_user: 0 | 1 = <default> 💡 重置接收次数
|
18084
18349
|
"""
|
18085
18350
|
api = complete_webapi("/share/updateshare", base_url=base_url)
|
18086
18351
|
return self.request(url=api, method="POST", data=payload, async_=async_, **request_kwargs)
|
@@ -18125,14 +18390,16 @@ class P115Client(P115OpenClient):
|
|
18125
18390
|
|
18126
18391
|
:payload:
|
18127
18392
|
- share_code: str
|
18128
|
-
- receive_code: str = <default> 💡
|
18129
|
-
- share_duration: int = <default> 💡 分享天数: 1(
|
18393
|
+
- receive_code: str = <default> 💡 接收码(访问密码)
|
18394
|
+
- share_duration: int = <default> 💡 分享天数: n(填入指定天数),-1(长期)
|
18130
18395
|
- is_custom_code: 0 | 1 = <default> 💡 用户自定义口令(不用管)
|
18131
18396
|
- auto_fill_recvcode: 0 | 1 = <default> 💡 分享链接自动填充口令(不用管)
|
18132
18397
|
- share_channel: int = <default> 💡 分享渠道代码(不用管)
|
18133
18398
|
- action: str = <default> 💡 操作: 取消分享 "cancel"
|
18134
18399
|
- skip_login_down_flow_limit: "" | int = <default> 💡 设置免登录下载限制流量,如果为 "" 则不限,单位: 字节
|
18135
18400
|
- access_user_ids = int | str = <default> 💡 设置访问账号,多个用逗号 "," 隔开
|
18401
|
+
- receive_user_limit: int = <default> 💡 接收次数
|
18402
|
+
- reset_receive_user: 0 | 1 = <default> 💡 重置接收次数
|
18136
18403
|
"""
|
18137
18404
|
api = complete_proapi("/2.0/share/updateshare", base_url, app)
|
18138
18405
|
return self.request(url=api, method="POST", data=payload, async_=async_, **request_kwargs)
|
@@ -20389,3 +20656,5 @@ for name, method in P115Client.__dict__.items():
|
|
20389
20656
|
CLIENT_API_MAP[match[1]] = "P115Client." + name
|
20390
20657
|
|
20391
20658
|
# TODO: 提供一个可随时终止和暂停的上传功能,并且可以输出进度条和获取进度
|
20659
|
+
# TODO: 更新一下,p115client._upload,做更多的封装,至少让断点续传更易于使用
|
20660
|
+
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: p115client
|
3
|
-
Version: 0.0.5.
|
3
|
+
Version: 0.0.5.8.1
|
4
4
|
Summary: Python 115 webdisk client.
|
5
5
|
Home-page: https://github.com/ChenyangGao/p115client
|
6
6
|
License: MIT
|
@@ -31,7 +31,7 @@ Requires-Dist: orjson
|
|
31
31
|
Requires-Dist: p115cipher (>=0.0.3)
|
32
32
|
Requires-Dist: posixpatht (>=0.0.3)
|
33
33
|
Requires-Dist: python-argtools (>=0.0.1)
|
34
|
-
Requires-Dist: python-asynctools (>=0.1)
|
34
|
+
Requires-Dist: python-asynctools (>=0.1.2)
|
35
35
|
Requires-Dist: python-concurrenttools (>=0.0.8.2)
|
36
36
|
Requires-Dist: python-cookietools (>=0.0.2.1)
|
37
37
|
Requires-Dist: python-dictattr (>=0.0.4)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
LICENSE,sha256=o5242_N2TgDsWwFhPn7yr8YJNF7XsJM5NxUMtcT97bc,1100
|
2
2
|
p115client/__init__.py,sha256=1mx7njuAlqcuEWONTjSiiGnXyyNyqOcJyNX1FMHqQ-4,214
|
3
3
|
p115client/_upload.py,sha256=j2XHz6-hc9qyfiF92aZY-LPJ3UgbB6e4Jy6CNGQ5rwk,29904
|
4
|
-
p115client/client.py,sha256=
|
4
|
+
p115client/client.py,sha256=BCga9CmcXjPovtNvvVHadTv6E3SztBomqNSidWW-WpY,707805
|
5
5
|
p115client/const.py,sha256=maIZfJAiUuEnXIKc8TMAyW_UboDUJPwYpPS8LjPFp_U,4321
|
6
6
|
p115client/exception.py,sha256=Ugjr__aSlYRDYwoOz7273ngV-gFX2z-ohsJmCba8nnQ,2657
|
7
7
|
p115client/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -17,7 +17,7 @@ p115client/tool/request.py,sha256=SWsezW9EYZGS3R-TbZxMG-8bN3YWJ0-GzgvKlvRBSCM,70
|
|
17
17
|
p115client/tool/upload.py,sha256=qK1OQYxP-Faq2eMDhc5sBXJiSr8m8EZ_gb0O_iA2TrI,15915
|
18
18
|
p115client/tool/xys.py,sha256=n89n9OLBXx6t20L61wJgfrP6V4jW3sHgyaQNBLdUwUQ,3578
|
19
19
|
p115client/type.py,sha256=e4g9URQBE23XN2dGomldj8wC6NlDWBBSVC5Bmd8giBc,5993
|
20
|
-
p115client-0.0.5.
|
21
|
-
p115client-0.0.5.
|
22
|
-
p115client-0.0.5.
|
23
|
-
p115client-0.0.5.
|
20
|
+
p115client-0.0.5.8.1.dist-info/LICENSE,sha256=o5242_N2TgDsWwFhPn7yr8YJNF7XsJM5NxUMtcT97bc,1100
|
21
|
+
p115client-0.0.5.8.1.dist-info/METADATA,sha256=iJ9MArKcRNHtI3JP6Zbx-cJiyrbqh-r78fuJoji4Wl4,8232
|
22
|
+
p115client-0.0.5.8.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
23
|
+
p115client-0.0.5.8.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|