Skip to content

Commit b3c74ed

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents 9e28f4a + 6b3cb9c commit b3c74ed

File tree

1 file changed

+22
-11
lines changed

1 file changed

+22
-11
lines changed

README.en.md

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#### **Introduction**
77

8-
🎉「[TikHub.io](https://tikhub.io/)"Is a**A platform for out-of-the-box integration tools and services**, our goal is to help users quickly start business and support function customization. Our vision is to form a community entrepreneurship project. A single tree cannot grow into a forest, but cooperation can lead to a win-win situation.**Every community member has the opportunity to integrate the functions or interfaces they write into our platform and benefit from them**. We have accumulated a large number of registered users and community users, and in order to realize this vision, we are actively planning and implementing cooperation strategies to ensure the sustainable and healthy development of the ecosystem. Welcome everyone to join us[Discord](https://discord.gg/aMEAS8Xsvz)Community.
8+
🎉「[TikHub.io](https://tikhub.io/)"Is a**开箱即用的集成工具以及服务的平台**, our goal is to help users quickly start business and support function customization. Our vision is to form a community entrepreneurship project. A single tree cannot grow into a forest, but cooperation can lead to a win-win situation.**Every community member has the opportunity to integrate the functions or interfaces they write into our platform and benefit from them**. We have accumulated a large number of registered users and community users, and in order to realize this vision, we are actively planning and implementing cooperation strategies to ensure the sustainable and healthy development of the ecosystem. Welcome everyone to join us[Discord](https://discord.gg/aMEAS8Xsvz)Community.
99

1010
* * *
1111

@@ -17,7 +17,7 @@ All APIs are written based on the OPenAPI specification, which means you can use
1717

1818
<https://api.tikhub.io/openapi.json>
1919

20-
Of course, we have used Swagger UI by default to display our API documents. You can open the following link on the web page, then authenticate the API Token on the web page, then click on any endpoint and click`Try it out`You can test the endpoints you need. Most endpoints already carry default values ​​or demo values, which will better help you understand the required parameters of the call:
20+
当然,我们已经默认使用了Swagger UI来展示我们的API文档,你可以在网页上打开下面的链接,然后在网页上进行API Token的认证,随后点击任意端点然后点击`Try it out`You can test the endpoints you need. Most endpoints already carry default values ​​or demo values, which will better help you understand the required parameters of the call:
2121

2222
<https://api.tikhub.io>
2323

@@ -71,12 +71,12 @@ from tikhub import Client
7171

7272
```python
7373
client = Client(base_url="https://api.tikhub.io",
74-
api_key="YOUR_API_TOKEN",
75-
proxies=None,
76-
max_retries=3,
77-
max_connections=50,
78-
timeout=10,
79-
max_tasks=50)
74+
api_key="YOUR_API_TOKEN",
75+
proxies=None,
76+
max_retries=3,
77+
max_connections=50,
78+
timeout=10,
79+
max_tasks=50)
8080
```
8181

8282
- Request user data example
@@ -107,7 +107,7 @@ all_endpoints_info = await client.TikHubUser.get_all_endpoints_info()
107107
print(all_endpoints_info)
108108
```
109109

110-
- Available properties in Client
110+
- Client中的可用属性
111111

112112
```python
113113
# TikHub
@@ -129,6 +129,9 @@ self.InstagramWeb = InstagramWeb(self.client)
129129

130130
# Weibo
131131
self.WeiboWeb = WeiboWeb(self.client)
132+
133+
# Captcha Solver
134+
self.CaptchaSolver = CaptchaSolver(self.client)
132135
```
133136

134137
- use`DouyinAppV1`of`fetch_one_video`The method calls the interface to obtain single video data.
@@ -142,8 +145,16 @@ print(video_data)
142145
- We have used HTTPX to asynchronously encapsulate most endpoints. If your code is executed synchronously, you can use the following code to prevent asynchronous infection.
143146

144147
```python
145-
# 使用asyncio.run防止异步传染到其他代码 | Use asyncio.run to prevent asynchronous infection to other code
146-
video_data = asyncio.run(client.DouyinAppV1.fetch_one_video(aweme_id="7345492945006595379"))
148+
import asyncio
149+
150+
# 获取抖音单一视频数据 | Get a single video data from Douyin
151+
def fetch_one_video(aweme_id: str):
152+
# 使用asyncio.run防止异步传染到其他代码
153+
# Use asyncio.run to prevent asynchronous infection to other code
154+
return asyncio.run(client.DouyinAppV1.fetch_one_video(aweme_id=aweme_id))
155+
156+
157+
video_data = fetch_one_video(aweme_id="7372484719365098803")
147158
print(video_data)
148159
```
149160

0 commit comments

Comments
 (0)