Skip to content

Commit ff410dd

Browse files
committed
Upgraded SDK V1.11.8 Add Support V5.1.7 API
1 parent a3a1d4b commit ff410dd

File tree

64 files changed

+67
-6
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+67
-6
lines changed

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

-10.2 KB
Binary file not shown.

dist/tikhub-1.0.0.tar.gz

-10.4 KB
Binary file not shown.

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

-10.2 KB
Binary file not shown.

dist/tikhub-1.0.1.tar.gz

-10.5 KB
Binary file not shown.

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

-9.71 KB
Binary file not shown.

dist/tikhub-1.0.2.tar.gz

-9.88 KB
Binary file not shown.

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

-15.9 KB
Binary file not shown.

dist/tikhub-1.0.3.tar.gz

-16.3 KB
Binary file not shown.

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

-35.3 KB
Binary file not shown.

dist/tikhub-1.0.4.tar.gz

-25.4 KB
Binary file not shown.

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

-35.3 KB
Binary file not shown.

dist/tikhub-1.0.5.tar.gz

-25.4 KB
Binary file not shown.

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

-43.6 KB
Binary file not shown.

dist/tikhub-1.0.6.tar.gz

-31.8 KB
Binary file not shown.

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

-50.2 KB
Binary file not shown.

dist/tikhub-1.0.7.tar.gz

-31.8 KB
Binary file not shown.

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

-50.2 KB
Binary file not shown.

dist/tikhub-1.0.8.tar.gz

-31.8 KB
Binary file not shown.

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

-51 KB
Binary file not shown.

dist/tikhub-1.0.9.tar.gz

-32.3 KB
Binary file not shown.

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

-51 KB
Binary file not shown.

dist/tikhub-1.10.0.tar.gz

-32.2 KB
Binary file not shown.

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

-51.8 KB
Binary file not shown.

dist/tikhub-1.10.1.tar.gz

-32.3 KB
Binary file not shown.

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

-51.4 KB
Binary file not shown.

dist/tikhub-1.10.2.tar.gz

-31.5 KB
Binary file not shown.

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

-53.5 KB
Binary file not shown.

dist/tikhub-1.10.3.tar.gz

-35.5 KB
Binary file not shown.

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

-53.9 KB
Binary file not shown.

dist/tikhub-1.10.4.tar.gz

-35.9 KB
Binary file not shown.

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

-54.1 KB
Binary file not shown.

dist/tikhub-1.10.5.tar.gz

-35.9 KB
Binary file not shown.

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

-54.9 KB
Binary file not shown.

dist/tikhub-1.10.6.tar.gz

-36.3 KB
Binary file not shown.

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

-54.8 KB
Binary file not shown.

dist/tikhub-1.10.7.tar.gz

-36.2 KB
Binary file not shown.

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

-56 KB
Binary file not shown.

dist/tikhub-1.10.8.tar.gz

-37.6 KB
Binary file not shown.

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

-57.5 KB
Binary file not shown.

dist/tikhub-1.10.9.tar.gz

-38.1 KB
Binary file not shown.

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

-57.6 KB
Binary file not shown.

dist/tikhub-1.11.0.tar.gz

-38.3 KB
Binary file not shown.

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

-58.9 KB
Binary file not shown.

dist/tikhub-1.11.1.tar.gz

-38.7 KB
Binary file not shown.

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.

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.

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

-60.8 KB
Binary file not shown.

dist/tikhub-1.11.4.tar.gz

-40.5 KB
Binary file not shown.

dist/tikhub-1.11.5.tar.gz

-42.4 KB
Binary file not shown.

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

-63.1 KB
Binary file not shown.

dist/tikhub-1.11.6.tar.gz

-42.4 KB
Binary file not shown.

dist/tikhub-1.11.8.tar.gz

43.3 KB
Binary file not shown.

setup.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
# twine upload dist/*
88

99
from setuptools import setup, find_packages
10+
from tikhub import version
1011

1112
with open("README.md", "r", encoding='utf8') as fh:
1213
long_description = fh.read()
1314

1415
setup(
1516
name="tikhub",
16-
version="1.11.6",
17+
version=version,
1718
author="TikHub.io",
1819
author_email="[email protected]",
1920
description="A Python SDK for TikHub RESTful API",

tikhub/__init__.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
from .client.client import Client
2+
from .version import version
3+
4+
__all__ = ["Client", "version"]
25

3-
__all__ = ["Client"]

tikhub/api/v1/endpoints/douyin/app/douyin_app_v3.py

+7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# 导入API SDK Client类
2+
from typing import List
23

34
from tikhub.http_client.api_client import APIClient
45

@@ -18,6 +19,12 @@ async def fetch_one_video(self, aweme_id: str):
1819
data = await self.client.fetch_get_json(f"{endpoint}?aweme_id={aweme_id}")
1920
return data
2021

22+
# 批量获取视频信息 (Batch Get Video Information)
23+
async def fetch_multi_video(self, aweme_ids: List[str]):
24+
endpoint = f"/api/v1/douyin/app/v3/fetch_multi_video"
25+
data = await self.client.fetch_post_json(endpoint, params={"aweme_ids": aweme_ids})
26+
return data
27+
2128
# 根据分享链接获取作品数据 | Get video data by sharing url
2229
async def fetch_one_video_by_share_url(self, share_url: str):
2330
endpoint = "/api/v1/douyin/app/v3/fetch_one_video_by_share_url"

tikhub/api/v1/endpoints/hybrid_parsing/__init__.py

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# 导入API SDK Client类
2+
import json
3+
4+
from tikhub.http_client.api_client import APIClient
5+
6+
7+
class HybridParsing:
8+
9+
# 初始化 | Initialize
10+
def __init__(self, client: APIClient):
11+
self.client = client
12+
13+
# 抖音TikTok的混合解析 | Hybrid parsing of Douyin and TikTok
14+
async def video_data(self, url: str, minimal: bool = False, base64_url: bool = False):
15+
endpoint = "/api/v1/hybrid/video_data"
16+
data = await self.client.fetch_get_json(f"{endpoint}?url={url}&minimal={minimal}&base64_url={base64_url}")
17+
return data

tikhub/api/v1/endpoints/instagram/web/instagram_web.py

+19-3
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ async def fetch_similar_accounts_by_username(self, username: str):
8888
data = await self.client.fetch_get_json(f"{endpoint}?username={username}")
8989
return data
9090

91-
9291
# 根据关键词搜索用户 | Search users by query
9392
async def fetch_search_users_by_keyword(self, keyword: str):
9493
endpoint = "/api/v1/instagram/web_app/fetch_search_users_by_keyword"
@@ -179,6 +178,25 @@ async def fetch_user_tv_posts_by_username(self, username: str, pagination_token:
179178
data = await self.client.fetch_get_json(f"{endpoint}?username={username}&pagination_token={pagination_token}")
180179
return data
181180

181+
# 根据URL获取帖子评论数据 | Get post comments by URL
182+
async def fetch_post_comments_by_url(self, url: str, pagination_token: str = None):
183+
endpoint = "/api/v1/instagram/web_app/fetch_post_comments_by_url"
184+
data = await self.client.fetch_get_json(f"{endpoint}?url={url}&pagination_token={pagination_token}")
185+
return data
186+
187+
# 根据评论ID获取评论回复数据 | Get comment replies by comment ID
188+
async def fetch_comment_replies_by_comment_id(self, url: str, comment_id: str, pagination_token: str = None):
189+
endpoint = "/api/v1/instagram/web_app/fetch_comment_replies_by_comment_id"
190+
data = await self.client.fetch_get_json(
191+
f"{endpoint}?url={url}&comment_id={comment_id}&pagination_token={pagination_token}")
192+
return data
193+
194+
# 根据URL获取帖子点赞数据 | Get post likes by URL
195+
async def fetch_post_likes_by_url(self, url: str):
196+
endpoint = "/api/v1/instagram/web_app/fetch_post_likes_by_url"
197+
data = await self.client.fetch_get_json(f"{endpoint}?url={url}")
198+
return data
199+
182200

183201
if __name__ == "__main__":
184202
import asyncio
@@ -196,5 +214,3 @@ async def main():
196214

197215

198216
asyncio.run(main())
199-
200-

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

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# 导入API SDK Client类
22
import json
3+
from typing import List
34

45
from tikhub.http_client.api_client import APIClient
56

@@ -16,6 +17,12 @@ async def fetch_one_video(self, aweme_id: int):
1617
data = await self.client.fetch_get_json(f"{endpoint}?aweme_id={aweme_id}")
1718
return data
1819

20+
# 批量获取视频信息 (Batch Get Video Information)
21+
async def fetch_multi_video(self, aweme_ids: List[str]):
22+
endpoint = f"/api/v1/tiktok/app/v3/fetch_multi_video"
23+
data = await self.client.fetch_post_json(endpoint, params={"aweme_ids": aweme_ids})
24+
return data
25+
1926
# 根据分享链接获取作品数据 | Get video data by sharing url
2027
async def fetch_one_video_by_share_url(self, share_url: str):
2128
endpoint = "/api/v1/tiktok/app/v3/fetch_one_video_by_share_url"

tikhub/client/client.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# import SDK Version
2+
from tikhub import version
3+
14
# http_client
25
from tikhub.http_client.api_client import APIClient
36

@@ -39,6 +42,9 @@
3942
# Net Ease Cloud Music
4043
from tikhub.api.v1.endpoints.net_ease_cloud_music.app.net_ease_cloud_music_app_v1 import NetEaseCloudMusicAppV1
4144

45+
# Hybrid Parsing
46+
from tikhub.api.v1.endpoints.hybrid_parsing.hybrid_parsing import HybridParsing
47+
4248

4349
class Client:
4450
def __init__(self,
@@ -62,7 +68,7 @@ def __init__(self,
6268
self.client = APIClient(
6369
base_url=self.base_url,
6470
client_headers={
65-
"User-Agent": "TikHub-API-SDK-Python/1.11.6",
71+
"User-Agent": f"TikHub-API-SDK-Python/{version}",
6672
"Authorization": f"Bearer {self.api_key}"
6773
},
6874
proxies=proxies,
@@ -109,3 +115,6 @@ def __init__(self,
109115

110116
# Net Ease Cloud Music
111117
self.NetEaseCloudMusicAppV1 = NetEaseCloudMusicAppV1(self.client)
118+
119+
# Hybrid Parsing
120+
self.HybridParsing = HybridParsing(self.client)

tikhub/version.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# tikhub/version.py
2+
version = "1.11.8"

0 commit comments

Comments
 (0)