p123client 0.0.6.1__tar.gz → 0.0.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: p123client
3
- Version: 0.0.6.1
3
+ Version: 0.0.6.2
4
4
  Summary: Python 123 webdisk client.
5
5
  Home-page: https://github.com/ChenyangGao/python-123-client
6
6
  License: MIT
@@ -742,6 +742,22 @@ class P123OpenClient:
742
742
 
743
743
  :payload:
744
744
  - fileID: int 💡 文件 id
745
+
746
+ :return:
747
+ 响应数据的 data 字段是一个字典,键值如下:
748
+
749
+ +---------------------+--------+----------+--------------------------------------------------------------+
750
+ | 名称 | 类型 | 是否必填 | 说明 |
751
+ +=====================+========+==========+==============================================================+
752
+ | list | array | 必填 | 响应列表 |
753
+ +---------------------+--------+----------+--------------------------------------------------------------|
754
+ | list[*].resolutions | string | 必填 | 分辨率 |
755
+ +---------------------+--------+----------+--------------------------------------------------------------|
756
+ | list[*].address | string | 必填 | 播放地址。请将播放地址放入支持的 hls 协议的播放器中进行播放。|
757
+ | | | | 示例在线播放地址: https://m3u8-player.com/ |
758
+ | | | | 请注意:转码链接播放过程中将会消耗您的直链流量。 |
759
+ | | | | 如果您开启了直链鉴权,也需要将转码链接根据鉴权指引进行签名。 |
760
+ +---------------------+--------+----------+--------------------------------------------------------------+
745
761
  """
746
762
  api = complete_url("/api/v1/direct-link/get/m3u8", base_url)
747
763
  if not isinstance(payload, dict):
@@ -832,6 +848,17 @@ class P123OpenClient:
832
848
 
833
849
  :payload:
834
850
  - ids: str 💡 视频文件 id 列表
851
+
852
+ :return:
853
+ 响应数据的 data 字段是一个字典,键值如下:
854
+
855
+ +-----------+-------+----------+-------------------------------------------+
856
+ | 名称 | 类型 | 是否必填 | 说明 |
857
+ +===========+=======+==========+===========================================+
858
+ | noneList | array | 必填 | 未发起过转码的 ID |
859
+ | errorList | array | 必填 | 错误文件ID列表,这些文件ID无法进行转码操作 |
860
+ | success | array | 必填 | 转码成功的文件ID列表 |
861
+ +-----------+-------+----------+-------------------------------------------+
835
862
  """
836
863
  api = complete_url("/api/v1/direct-link/queryTranscode", base_url)
837
864
  if not isinstance(payload, dict):
@@ -2296,8 +2323,8 @@ class P123OpenClient:
2296
2323
  """
2297
2324
  api = complete_url("/upload/v1/oss/file/create", base_url)
2298
2325
  payload = dict_to_lower_merge(payload, type=1)
2299
- if not payload.get("duplicate"):
2300
- payload.pop("duplicate", None)
2326
+ if "duplicate" in payload and not payload["duplicate"]:
2327
+ del payload["duplicate"]
2301
2328
  return self.request(api, "POST", json=payload, async_=async_, **request_kwargs)
2302
2329
 
2303
2330
  @overload
@@ -3642,8 +3669,8 @@ class P123OpenClient:
3642
3669
  "parentFileId": 0,
3643
3670
  "containDir": "false",
3644
3671
  })
3645
- if not payload.get("duplicate"):
3646
- payload.pop("duplicate", None)
3672
+ if "duplicate" in payload and not payload["duplicate"]:
3673
+ del payload["duplicate"]
3647
3674
  return self.request(api, "POST", json=payload, async_=async_, **request_kwargs)
3648
3675
 
3649
3676
  @overload
@@ -1,7 +1,10 @@
1
1
  #!/usr/bin/env python3
2
2
  # encoding: utf-8
3
3
 
4
- __all__ = ["P123Warning", "P123OSError", "P123BrokenUpload"]
4
+ __all__ = [
5
+ "P123Warning", "P123OSError", "P123BrokenUpload",
6
+ "P123AccessTokenError", "P123AuthenticationError",
7
+ ]
5
8
 
6
9
  import warnings
7
10
 
@@ -47,3 +50,11 @@ class P123OSError(OSError):
47
50
  class P123BrokenUpload(P123OSError):
48
51
  pass
49
52
 
53
+
54
+ class P123AccessTokenError(P123OSError):
55
+ pass
56
+
57
+
58
+ class P123AuthenticationError(P123OSError):
59
+ pass
60
+
@@ -280,7 +280,7 @@ def _iterdir(
280
280
  :return: 迭代器,产生文件或目录的信息
281
281
  """
282
282
  default_payload = payload
283
- page_size = int(payload["limit"])
283
+ page_size = int(payload.setdefault("limit", 100))
284
284
  def gen_step():
285
285
  nonlocal parent_id
286
286
  dq: deque[tuple[int, int, str]] = deque()
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "p123client"
3
- version = "0.0.6.1"
3
+ version = "0.0.6.2"
4
4
  description = "Python 123 webdisk client."
5
5
  authors = ["ChenyangGao <wosiwujm@gmail.com>"]
6
6
  license = "MIT"
File without changes
File without changes