diff --git a/dist/tikhub-1.12.7-py3-none-any.whl b/dist/tikhub-1.12.7-py3-none-any.whl new file mode 100644 index 0000000..fe2e00b Binary files /dev/null and b/dist/tikhub-1.12.7-py3-none-any.whl differ diff --git a/dist/tikhub-1.12.7.tar.gz b/dist/tikhub-1.12.7.tar.gz new file mode 100644 index 0000000..486ff0f Binary files /dev/null and b/dist/tikhub-1.12.7.tar.gz differ diff --git a/tikhub/api/v1/endpoints/douyin/web/douyin_web.py b/tikhub/api/v1/endpoints/douyin/web/douyin_web.py index 503882d..ec19960 100644 --- a/tikhub/api/v1/endpoints/douyin/web/douyin_web.py +++ b/tikhub/api/v1/endpoints/douyin/web/douyin_web.py @@ -23,6 +23,31 @@ async def fetch_one_video(self, aweme_id: str): data = await self.client.fetch_get_json(f"{endpoint}?aweme_id={aweme_id}") return data + # 获取单个作品数据V2 | Get single video data V2 + async def fetch_one_video_v2(self, aweme_id: str): + """ + 获取单个作品数据 | Get single video data + :param aweme_id: 作品id | Video id + :return: 作品数据 | Video data + """ + endpoint = "/api/v1/douyin/web/fetch_one_video_v2" + data = await self.client.fetch_get_json(f"{endpoint}?aweme_id={aweme_id}") + return data + + # 获取相关作品推荐数据 | Get related video recommendation data + async def fetch_related_posts(self, aweme_id: str, refresh_index: int = 1, count: int = 20): + """ + 获取相关作品推荐数据 | Get related video recommendation data + :param aweme_id: 作品id | Video id + :param refresh_index: 刷新索引 | Refresh index + :param count: 数量 | Number + :return: 相关作品推荐数据 | Related video recommendation data + """ + endpoint = "/api/v1/douyin/web/fetch_related_posts" + data = await self.client.fetch_get_json( + f"{endpoint}?aweme_id={aweme_id}&refresh_index={refresh_index}&count={count}") + return data + # 获取单个作品视频弹幕数据 | Get single video danmaku data async def fetch_one_video_danmaku(self, item_id: str, duration: int, end_time: int, start_time: int): """ diff --git a/tikhub/api/v1/endpoints/tiktok/web/tiktok_web.py b/tikhub/api/v1/endpoints/tiktok/web/tiktok_web.py index 8e28a11..16733db 100644 --- a/tikhub/api/v1/endpoints/tiktok/web/tiktok_web.py +++ b/tikhub/api/v1/endpoints/tiktok/web/tiktok_web.py @@ -222,6 +222,12 @@ async def fetch_tiktok_live_data(self, live_room_url: str): data = await self.client.fetch_get_json(f"{endpoint}?live_room_url={live_room_url}") return data + # 获取直播间首页推荐列表 | Get live room home page recommendation list + async def fetch_live_recommend(self, related_live_tag: str): + endpoint = "/api/v1/tiktok/web/fetch_live_recommend" + data = await self.client.fetch_get_json(f"{endpoint}?related_live_tag={related_live_tag}") + return data + if __name__ == "__main__": import asyncio diff --git a/tikhub/api/v1/endpoints/xiaohongshu/web/xiaohongshu_web.py b/tikhub/api/v1/endpoints/xiaohongshu/web/xiaohongshu_web.py index 00709aa..1f0d48c 100644 --- a/tikhub/api/v1/endpoints/xiaohongshu/web/xiaohongshu_web.py +++ b/tikhub/api/v1/endpoints/xiaohongshu/web/xiaohongshu_web.py @@ -14,6 +14,12 @@ async def get_note_info(self, note_id: str): data = await self.client.fetch_get_json(f"{endpoint}?note_id={note_id}") return data + # 获取笔记信息 V2 + async def get_note_info_v2(self, note_id: str): + endpoint = "/api/v1/xiaohongshu/web/get_note_info_v2" + data = await self.client.fetch_get_json(f"{endpoint}?note_id={note_id}") + return data + # 获取用户信息 async def get_user_info(self, user_id: str): endpoint = "/api/v1/xiaohongshu/web/get_user_info" diff --git a/tikhub/version.py b/tikhub/version.py index 7d7d42c..b92b1b9 100644 --- a/tikhub/version.py +++ b/tikhub/version.py @@ -1,2 +1,2 @@ # tikhub/version.py -version = "1.12.6" +version = "1.12.7"