Skip to content

Commit f12de63

Browse files
authored
Add demo
1 parent 2f66d11 commit f12de63

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

README.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1-
# TikHub_PyPi([API.TikHub.io](https://api.tikhub.io/docs))
1+
<div align="center">
22

3-
[API.TikHub.io](https://api.tikhub.io/docs),是一个异步高性能的Douyin,TikTok数据爬取工具,此Repo为基于该API的PyPi包,方便各位开发者调用。
3+
# [TikHub_PyPi](https://pypi.org/project/tikhub)
44

5+
[api.tikhub.io](https://api.tikhub.io/docs)」,是一个异步高性能的Douyin,TikTok数据爬取在线工具,此repo为基于该API的封装,方便各位开发者调用。
6+
7+
PyPi:[https://pypi.org/project/tikhub](https://pypi.org/project/tikhub)
8+
9+
[English](./README.en.md) | [简体中文](./README.md)
10+
11+
</div>
512

613
## 注释
714

@@ -59,7 +66,14 @@
5966

6067
## 使用示例
6168

69+
> 查看[demo.py](https://github.com/TikHubIO/TikHub_PyPi/blob/main/demo/demo.py)
70+
6271
```python
72+
import asyncio
73+
import time
74+
75+
from tikhub.api import API
76+
6377
async def async_test() -> None:
6478
# 异步测试/Async test
6579

@@ -69,7 +83,7 @@ async def async_test() -> None:
6983

7084
douyin_url = 'https://www.douyin.com/video/7153585499477757192'
7185

72-
douyin_user_url = 'https://www.douyin.com/user/MS4wLjABAAAA-Hu1YKTuhE3QkCHD5yU26k--RUZiaoMRtpfmeid-Z_o'
86+
douyin_user_url = 'https://www.douyin.com/user/MS4wLjABAAAAaNJuvXC83kL5nhaZHubKdjsRJQovgz58wXzlLnJUsslG-Kb24TM1QJlf_2HMaUJk'
7387

7488
print("Test start...\n")
7589
start_time = time.time()
@@ -122,6 +136,7 @@ async def async_test() -> None:
122136
# 获取用户主页的所有点赞视频数据/Get all liked video data on the user's homepage
123137
print("Running test : API.get_douyin_profile_liked_videos()")
124138
aweme_list = await api.get_douyin_profile_liked_videos(douyin_user_url, 20)
139+
print(f'Get {len(aweme_list)} liked videos from profile')
125140

126141
# 总耗时/Total time
127142
total_time = round(time.time() - start_time, 2)
@@ -136,3 +151,5 @@ if __name__ == '__main__':
136151
)
137152
asyncio.run(async_test())
138153
```
154+
155+

0 commit comments

Comments
 (0)