Skip to content

Commit

Permalink
Upgraded SDK V1.11.3 Fix and Sync TikTok V2 V3 API
Browse files Browse the repository at this point in the history
  • Loading branch information
Evil0ctal committed Jun 28, 2024
1 parent c548061 commit a780e0a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
Binary file added dist/tikhub-1.11.3-py3-none-any.whl
Binary file not shown.
Binary file added dist/tikhub-1.11.3.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

setup(
name="tikhub",
version="1.11.2",
version="1.11.3",
author="TikHub.io",
author_email="[email protected]",
description="A Python SDK for TikHub RESTful API",
Expand Down
8 changes: 4 additions & 4 deletions tikhub/api/v1/endpoints/tiktok/app/tiktok_app_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,17 @@ async def fetch_hashtag_post_list(self, ch_id: int, cursor: int, count: int):
return data

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

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

# 获取直播间排行榜数据 | Get live room ranking list
Expand Down
14 changes: 10 additions & 4 deletions tikhub/api/v1/endpoints/tiktok/app/tiktok_app_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,23 @@ async def fetch_hashtag_video_list(self, ch_id: int, cursor: int, count: int):
return data

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

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

# 获取指定直播间的数据 | Get data of specified live room
async def fetch_live_room_info(self, room_id: str):
endpoint = "/api/v1/tiktok/app/v3/fetch_live_room_info"
data = await self.client.fetch_get_json(f"{endpoint}?room_id={room_id}")
return data

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

0 comments on commit a780e0a

Please sign in to comment.