1
- # TikHub_PyPi( [ API.TikHub.io ] ( https://api.tikhub.io/docs ) )
1
+ < div align = " center " >
2
2
3
- [ API.TikHub.io ] ( https://api.tikhub.io/docs ) ,是一个异步高性能的Douyin,TikTok数据爬取工具,此Repo为基于该API的PyPi包,方便各位开发者调用。
3
+ # [ TikHub_PyPi ] ( https://pypi.org/project/tikhub )
4
4
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 >
5
12
6
13
## 注释
7
14
59
66
60
67
## 使用示例
61
68
69
+ > 查看[ demo.py] ( https://github.com/TikHubIO/TikHub_PyPi/blob/main/demo/demo.py )
70
+
62
71
``` python
72
+ import asyncio
73
+ import time
74
+
75
+ from tikhub.api import API
76
+
63
77
async def async_test () -> None :
64
78
# 异步测试/Async test
65
79
@@ -69,7 +83,7 @@ async def async_test() -> None:
69
83
70
84
douyin_url = ' https://www.douyin.com/video/7153585499477757192'
71
85
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 '
73
87
74
88
print (" Test start...\n " )
75
89
start_time = time.time()
@@ -122,6 +136,7 @@ async def async_test() -> None:
122
136
# 获取用户主页的所有点赞视频数据/Get all liked video data on the user's homepage
123
137
print (" Running test : API.get_douyin_profile_liked_videos()" )
124
138
aweme_list = await api.get_douyin_profile_liked_videos(douyin_user_url, 20 )
139
+ print (f ' Get { len (aweme_list)} liked videos from profile ' )
125
140
126
141
# 总耗时/Total time
127
142
total_time = round (time.time() - start_time, 2 )
@@ -136,3 +151,5 @@ if __name__ == '__main__':
136
151
)
137
152
asyncio.run(async_test())
138
153
```
154
+
155
+
0 commit comments