p123client 0.0.6.3__py3-none-any.whl → 0.0.6.4__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.
p123client/client.py CHANGED
@@ -4611,6 +4611,67 @@ class P123Client(P123OpenClient):
4611
4611
  **request_kwargs,
4612
4612
  )
4613
4613
 
4614
+ @overload
4615
+ def download_url(
4616
+ self,
4617
+ payload: dict | int | str,
4618
+ /,
4619
+ *,
4620
+ async_: Literal[False] = False,
4621
+ **request_kwargs,
4622
+ ) -> str:
4623
+ ...
4624
+ @overload
4625
+ def download_url(
4626
+ self,
4627
+ payload: dict | int | str,
4628
+ /,
4629
+ *,
4630
+ async_: Literal[True],
4631
+ **request_kwargs,
4632
+ ) -> Coroutine[Any, Any, str]:
4633
+ ...
4634
+ def download_url(
4635
+ self,
4636
+ payload: dict | int | str,
4637
+ /,
4638
+ *,
4639
+ async_: Literal[False, True] = False,
4640
+ **request_kwargs,
4641
+ ) -> str | Coroutine[Any, Any, str]:
4642
+ """获取下载链接
4643
+
4644
+ :params payload: 文件 id 或者文件信息,文件信息必须包含的信息如下:
4645
+
4646
+ - S3KeyFlag: str 💡 存储桶名
4647
+ - Etag: str 💡 文件的 MD5 散列值
4648
+ - Size: int 💡 文件大小
4649
+ - FileName: str = <default> 💡 默认用 Etag(即 MD5)作为文件名
4650
+
4651
+ :params async_: 是否异步
4652
+ :params request_kwargs: 其它请求参数
4653
+
4654
+ :return: 下载链接
4655
+ """
4656
+ def gen_step():
4657
+ if isinstance(payload, dict):
4658
+ resp = yield self.download_info(
4659
+ payload,
4660
+ async_=async_,
4661
+ **request_kwargs,
4662
+ )
4663
+ check_response(resp)
4664
+ return resp["data"]["DownloadUrl"]
4665
+ else:
4666
+ resp = yield self.download_info_open(
4667
+ payload,
4668
+ async_=async_,
4669
+ **request_kwargs,
4670
+ )
4671
+ check_response(resp)
4672
+ return resp["data"]["downloadUrl"]
4673
+ return run_gen_step(gen_step, async_=async_)
4674
+
4614
4675
  @overload
4615
4676
  def fs_copy(
4616
4677
  self,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: p123client
3
- Version: 0.0.6.3
3
+ Version: 0.0.6.4
4
4
  Summary: Python 123 webdisk client.
5
5
  Home-page: https://github.com/ChenyangGao/p123client
6
6
  License: MIT
@@ -1,12 +1,12 @@
1
1
  LICENSE,sha256=o5242_N2TgDsWwFhPn7yr8YJNF7XsJM5NxUMtcT97bc,1100
2
2
  p123client/__init__.py,sha256=gfUum-q3f_XuXOk2HpArDAIxAlscZm8Fau1kiNkNFpg,214
3
- p123client/client.py,sha256=E4X5qEKnkDb17KGiy7CrhzKBkQ8ukFTFM6qxUzGsnVg,246781
3
+ p123client/client.py,sha256=Ha09EnH9tC2CfacGH7DaO93BUVB6wRDiSym32In2WFw,248614
4
4
  p123client/const.py,sha256=T17OzPQrnIG6w_Hzjc8TF_fFMKa-hQMSn1gff8pVcBc,56
5
5
  p123client/exception.py,sha256=020xGo8WQmGCJz1UzNg9oFzpEvToQcgTye0s6lkFASQ,1540
6
6
  p123client/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  p123client/tool/__init__.py,sha256=2k_tcc67O9QG4wzESIdnAwqNHybCGlrsnxo_uBqBhEI,16673
8
8
  p123client/type.py,sha256=T17OzPQrnIG6w_Hzjc8TF_fFMKa-hQMSn1gff8pVcBc,56
9
- p123client-0.0.6.3.dist-info/LICENSE,sha256=o5242_N2TgDsWwFhPn7yr8YJNF7XsJM5NxUMtcT97bc,1100
10
- p123client-0.0.6.3.dist-info/METADATA,sha256=MgwA-g5ZGjXIchhxrFkYLPIoPeVJU96399yiIkxlBPw,8855
11
- p123client-0.0.6.3.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
12
- p123client-0.0.6.3.dist-info/RECORD,,
9
+ p123client-0.0.6.4.dist-info/LICENSE,sha256=o5242_N2TgDsWwFhPn7yr8YJNF7XsJM5NxUMtcT97bc,1100
10
+ p123client-0.0.6.4.dist-info/METADATA,sha256=7l04-PIItAf9zNy88qMzDiis2KeBX8HNucLCtvsO3ik,8855
11
+ p123client-0.0.6.4.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
12
+ p123client-0.0.6.4.dist-info/RECORD,,