Skip to content

Commit 89d2264

Browse files
committed
Upgraded SDK V1.11.2 Support Kuaishou API
1 parent 56ac934 commit 89d2264

File tree

5 files changed

+38
-2
lines changed

5 files changed

+38
-2
lines changed

README.md

+19-1
Original file line numberDiff line numberDiff line change
@@ -213,4 +213,22 @@ def fetch_one_video(aweme_id: str):
213213
loop.close()
214214
```
215215

216-
- 由于章节有限,在此处就不列出完整的方法了,你可以通过查看源代码的形式查看每一个属性内实现的方法,并且每个方法接受的参数都已经加上了`type hints`
216+
- 由于章节有限,在此处就不列出完整的方法了,你可以通过查看源代码的形式查看每一个属性内实现的方法,每一个方法的命名都是根据端点的`uri`来命名的,例如`/api/v1/douyin/app/v1/fetch_one_video`的方法名就是`fetch_one_video`,你可以根据API文档中的端点来查找对应的方法。
217+
- 并且每个方法接受的参数都已经加上了`type hints`,你可以通过查看方法的参数来了解该方法需要传入的参数类型,这样可以更好的帮助你调用方法。
218+
- 文档中可以自动帮你生成不同编程语言的代码,具体请查看[API Documentation](https://docs.tikhub.io/)
219+
- 目前可以自动生成代码的编程语言有:
220+
- Shell
221+
- JavaScript
222+
- Java
223+
- Swift
224+
- Go
225+
- PHP
226+
- Python
227+
- HTTP
228+
- C
229+
- C#
230+
- Objective-C
231+
- Ruby
232+
- OCaml
233+
- Dart
234+
- R

dist/tikhub-1.11.2-py3-none-any.whl

59.6 KB
Binary file not shown.

dist/tikhub-1.11.2.tar.gz

40.1 KB
Binary file not shown.

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
setup(
1515
name="tikhub",
16-
version="1.11.1",
16+
version="1.11.2",
1717
author="TikHub.io",
1818
author_email="[email protected]",
1919
description="A Python SDK for TikHub RESTful API",

tikhub/api/v1/endpoints/kuaishou/web/kuaishou_web.py

+18
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,24 @@ async def fetch_one_video(self, photo_id: str):
1515
data = await self.client.fetch_get_json(f"{endpoint}?photo_id={photo_id}")
1616
return data
1717

18+
# 快手单一视频查询接口V2 (Kuaishou Single Video Query API V2)
19+
async def fetch_one_video_v2(self, photo_id: str, isLongVideo: bool = False):
20+
endpoint = "/api/v1/kuaishou/web/fetch_one_video_v2"
21+
data = await self.client.fetch_get_json(f"{endpoint}?photo_id={photo_id}&isLongVideo={isLongVideo}")
22+
return data
23+
24+
# 根据链接获取单个作品数据 (Fetch Single Video By URL)
25+
async def fetch_one_video_by_url(self, url: str):
26+
endpoint = "/api/v1/kuaishou/web/fetch_one_video_by_url"
27+
data = await self.client.fetch_get_json(f"{endpoint}?url={url}")
28+
return data
29+
30+
# 根据链接获取单个作品数据V2 (Fetch Single Video By URL V2)
31+
async def fetch_one_video_by_url_v2(self, url: str):
32+
endpoint = "/api/v1/kuaishou/web/fetch_one_video_by_url_v2"
33+
data = await self.client.fetch_get_json(f"{endpoint}?url={url}")
34+
return data
35+
1836
# 获取单个作品评论数据 (Fetch Single Video Comment Data)
1937
async def fetch_one_video_comment(self, photo_id: str, pcursor: str = None):
2038
endpoint = "/api/v1/kuaishou/web/fetch_one_video_comment"

0 commit comments

Comments
 (0)