Skip to content

Commit a780e0a

Browse files
committed
Upgraded SDK V1.11.3 Fix and Sync TikTok V2 V3 API
1 parent c548061 commit a780e0a

File tree

5 files changed

+15
-9
lines changed

5 files changed

+15
-9
lines changed

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

59.7 KB
Binary file not shown.

dist/tikhub-1.11.3.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.2",
16+
version="1.11.3",
1717
author="TikHub.io",
1818
author_email="[email protected]",
1919
description="A Python SDK for TikHub RESTful API",

tikhub/api/v1/endpoints/tiktok/app/tiktok_app_v2.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -121,17 +121,17 @@ async def fetch_hashtag_post_list(self, ch_id: int, cursor: int, count: int):
121121
return data
122122

123123
# 获取指定用户的粉丝列表数据 | Get follower list of specified user
124-
async def fetch_user_follower_list(self, sec_user_id: str, count: int, max_time: int):
124+
async def fetch_user_follower_list(self, sec_user_id: str, count: int = 20, min_time: int = 0, page_token: str = ""):
125125
endpoint = "/api/v1/tiktok/app/v2/fetch_user_follower_list"
126126
data = await self.client.fetch_get_json(
127-
f"{endpoint}?sec_user_id={sec_user_id}&count={count}&max_time={max_time}")
127+
f"{endpoint}?sec_user_id={sec_user_id}&count={count}&min_time={min_time}&page_token={page_token}")
128128
return data
129129

130130
# 获取指定用户的关注列表数据 | Get following list of specified user
131-
async def fetch_user_following_list(self, sec_user_id: str, count: int, max_time: int):
131+
async def fetch_user_following_list(self, sec_user_id: str, count: int = 20, min_time: int = 0, page_token: str = ""):
132132
endpoint = "/api/v1/tiktok/app/v2/fetch_user_following_list"
133133
data = await self.client.fetch_get_json(
134-
f"{endpoint}?sec_user_id={sec_user_id}&count={count}&max_time={max_time}")
134+
f"{endpoint}?sec_user_id={sec_user_id}&count={count}&min_time={min_time}&page_token={page_token}")
135135
return data
136136

137137
# 获取直播间排行榜数据 | Get live room ranking list

tikhub/api/v1/endpoints/tiktok/app/tiktok_app_v3.py

+10-4
Original file line numberDiff line numberDiff line change
@@ -127,17 +127,23 @@ async def fetch_hashtag_video_list(self, ch_id: int, cursor: int, count: int):
127127
return data
128128

129129
# 获取指定用户的粉丝列表数据 | Get follower list of specified user
130-
async def fetch_user_follower_list(self, sec_user_id: str, count: int, max_time: int):
130+
async def fetch_user_follower_list(self, sec_user_id: str, count: int = 20, min_time: int = 0, page_token: str = ""):
131131
endpoint = "/api/v1/tiktok/app/v3/fetch_user_follower_list"
132132
data = await self.client.fetch_get_json(
133-
f"{endpoint}?sec_user_id={sec_user_id}&count={count}&max_time={max_time}")
133+
f"{endpoint}?sec_user_id={sec_user_id}&count={count}&min_time={min_time}&page_token={page_token}")
134134
return data
135135

136136
# 获取指定用户的关注列表数据 | Get following list of specified user
137-
async def fetch_user_following_list(self, sec_user_id: str, count: int, max_time: int):
137+
async def fetch_user_following_list(self, sec_user_id: str, count: int = 20, min_time: int = 0, page_token: str = ""):
138138
endpoint = "/api/v1/tiktok/app/v3/fetch_user_following_list"
139139
data = await self.client.fetch_get_json(
140-
f"{endpoint}?sec_user_id={sec_user_id}&count={count}&max_time={max_time}")
140+
f"{endpoint}?sec_user_id={sec_user_id}&count={count}&min_time={min_time}&page_token={page_token}")
141+
return data
142+
143+
# 获取指定直播间的数据 | Get data of specified live room
144+
async def fetch_live_room_info(self, room_id: str):
145+
endpoint = "/api/v1/tiktok/app/v3/fetch_live_room_info"
146+
data = await self.client.fetch_get_json(f"{endpoint}?room_id={room_id}")
141147
return data
142148

143149
# TikTok直播间排行榜 | Get live room ranking list

0 commit comments

Comments
 (0)