11<div align =" center " >
22
3- # [ tikhub_pp ] ( https://pypi.org/project/tikhub )
3+ # [ tikhub_op_pp ] ( https://pypi.org/project/tikhub )
44
55「[ api.tikhub.io] ( https://api.tikhub.io/docs ) ", is an asynchronous high-performance Douyin and TikTok data crawling online tool. This repo is a package based on this API, which is convenient for developers to call.
66
@@ -10,69 +10,21 @@ Pee:<https://pypi.org/project/tikhub>
1010
1111</div >
1212
13- ## note
13+ ## 使用示例
1414
15- > This project uses the following Emoji to indicate the development status in the development chart!
15+ > Check [ test.py ] ( https://github.com/TikHubIO/TikHub_PyPi/blob/main/test/test.py )
1616
17- | Emoji | representative meaning |
18- | :---: | :-------------------------------------------------------------------------------------------------------------------: |
19- | 🚀 | Rocket - The feature is written, tested, and deployed to production. |
20- | ✅ | Check mark - the feature is written, but has yet to be tested and will be deployed to production once the tests pass. |
21- | ❌ | Cross sign - The feature has not yet been written or has not been written yet. |
22- | 🔜 | SOON BREAK - Feature proposed but not yet assigned a designated developer. |
23- | ⚠️ | Warning symbol - There is a problem with the function that needs to be fixed. |
17+ - Install
2418
25- ## project progress
26-
27- | state | API endpoint path | Function |
28- | :---: | :---------------: | :--------------------: |
29- | 🚀 | ` /token ` | generate` Bearer Token ` |
30- | 🚀 | ` /users/me/ ` | Get user information |
31-
32- > Requirements for each interface endpoint
33-
34- | state | support platform | need | start date | ETA date | Developer |
35- | :---: | :--------------- | :----------------------------------------------: | :--------: | :-------: | :--------: |
36- | 🚀 | Douyin, TikTok | Crawl a single video data | 2022/10/08 | completed | @Evil0ctal |
37- | 🚀 | Douyin, TikTok | Crawl a single video comment data | 2022/10/08 | completed | @Evil0ctal |
38- | 🚀 | Douyin, TikTok | Crawl the soundtrack data | 2022/10/08 | completed | @Evil0ctal |
39- | 🚀 | Douyin, TikTok | Crawl user homepage video data | 2022/10/08 | completed | @Evil0ctal |
40- | 🚀 | Douyin, TikTok | Crawl the user homepage has liked the video data | 2022/10/08 | completed | @Evil0ctal |
41-
42- > Production and deployment of Douyin-related interfaces - API tags: Douyin
43-
44- | state | API endpoint path | Function | issue |
45- | :---: | :-----------------------------: | :----------------------------------------------: | :-------------------: |
46- | 🚀 | ` /douyin_video_data/ ` | Crawl a single video data | no known issues |
47- | ⚠️ | ` /douyin_video_comments/ ` | Crawl a single video comment data | Invalid to be updated |
48- | ⚠️ | ` /douyin_music_videos/ ` | Crawl the soundtrack data | Invalid to be updated |
49- | 🚀 | ` /douyin_profile_videos/ ` | Crawl user homepage video data | no known issues |
50- | 🚀 | ` /douyin_profile_liked_videos/ ` | Crawl the user homepage has liked the video data | no known issues |
51-
52- > Production deployment of TikTok-related interfaces - API tags: TikTok
53-
54- | state | API endpoint path | Function | issue |
55- | :---: | :-----------------------------: | :----------------------------------------------: | :-------------: |
56- | 🚀 | ` /tiktok_video_data/ ` | Crawl a single video data | no known issues |
57- | 🚀 | ` /tiktok_video_comments/ ` | Crawl a single video comment data | no known issues |
58- | 🚀 | ` /tiktok_music_videos/ ` | Crawl the soundtrack data | no known issues |
59- | 🚀 | ` /tiktok_profile_videos/ ` | Crawl user homepage video data | no known issues |
60- | 🚀 | ` /tiktok_profile_liked_videos/ ` | Crawl the user homepage has liked the video data | no known issues |
61-
62- ## to do` Todo ` the list
63-
64- - [ ] ⚠️ fix` /douyin_video_comments/ ` endpoint
65- - [ ] ⚠️ fix` /douyin_music_videos/ ` endpoint
66-
67- ## Example of use
19+ ``` bash
20+ pip install tikhub
21+ ```
6822
69- > Check [ demo.py ] ( https://github.com/TikHubIO/TikHub_PyPi/blob/main/demo/demo.py )
23+ - Usage
7024
7125``` python
72- import asyncio
73- import time
26+ from tikhub.api import *
7427
75- from tikhub.api import API
7628
7729async def async_test () -> None :
7830 # 异步测试/Async test
@@ -89,54 +41,62 @@ async def async_test() -> None:
8941 start_time = time.time()
9042
9143 # 获取TikHub请求头/Get TikHub request header
92- print (" Running test : API.authenticate()" )
93- await api.authenticate()
44+ r = await api.user_login()
45+ print (" Running test : API.user_login()" )
46+ print (r)
9447
9548 # 获取TikHub用户信息/Get TikHub user information
9649 print (" Running test : API.get_user_info()" )
97- await api.get_user_info()
50+ r = await api.get_user_info()
51+ print (r)
9852
9953 print (" \n Running ALL TikTok methods test...\n " )
10054
10155 # 获取单个视频数据/Get single video data
10256 print (" Running test : API.get_tiktok_video_data()" )
103- await api.get_tiktok_video_data(tiktok_url)
57+ r = await api.get_tiktok_video_data(tiktok_url)
58+ # print(r)
10459
10560 # 获取获取用户主页的所有视频数据/Get all video data on the user's homepage
10661 print (" Running test : API.get_tiktok_profile_videos()" )
107- aweme_list = await api.get_tiktok_profile_videos(tiktok_url, 20 )
108- print (f ' Get { len (aweme_list )} videos from profile ' )
62+ r = await api.get_tiktok_profile_videos(tiktok_url, cursor = None , count = None , get_all = False )
63+ print (f ' Get { len (r )} videos from profile ' )
10964
11065 # 获取用户主页的所有点赞视频数据/Get all liked video data on the user's homepage
11166 print (" Running test : API.get_tiktok_profile_liked_videos()" )
112- aweme_list = await api.get_tiktok_profile_liked_videos(tiktok_url, 20 )
113- print (f ' Get { len (aweme_list )} liked videos from profile ' )
67+ r = await api.get_tiktok_profile_liked_videos(tiktok_url, cursor = None , count = None , get_all = False )
68+ print (f ' Get { len (r )} liked videos from profile ' )
11469
11570 # 获取TikTok视频的所有评论数据/Get all comment data of TikTok video
11671 print (" Running test : API.get_tiktok_video_comments()" )
117- comments_list = await api.get_tiktok_video_comments(tiktok_url, 20 )
118- print (f ' Get { len (comments_list )} comments from video ' )
72+ r = await api.get_tiktok_video_comments(tiktok_url, cursor = None , count = None , get_all = False )
73+ print (f ' Get { len (r )} comments from video ' )
11974
12075 # 获取音乐页面上的所有(理论上能抓取到的)视频数据/Get all (theoretically) video data on the music page
12176 print (" Running test : API.get_tiktok_music_videos()" )
122- aweme_list = await api.get_tiktok_music_videos(tiktok_music_url, 20 )
123- print (f ' Get { len (aweme_list )} videos from music ' )
77+ r = await api.get_tiktok_music_videos(tiktok_music_url, cursor = None , count = None , get_all = False )
78+ print (f ' Get { len (r )} videos from music ' )
12479
12580 print (" \n Running ALL Douyin methods test...\n " )
12681
12782 # 获取单个视频数据/Get single video data
12883 print (" Running test : API.get_douyin_video_data()" )
129- await api.get_douyin_video_data(douyin_url)
84+ r = await api.get_douyin_video_data(douyin_url)
13085
13186 # 获取获取用户主页的所有视频数据/Get all video data on the user's homepage
13287 print (" Running test : API.get_douyin_profile_videos()" )
133- aweme_list = await api.get_douyin_profile_videos(douyin_user_url, 20 )
134- print (f ' Get { len (aweme_list )} videos from profile ' )
88+ r = await api.get_douyin_profile_videos(douyin_user_url, cursor = None , count = None , get_all = False )
89+ print (f ' Get { len (r )} videos from profile ' )
13590
13691 # 获取用户主页的所有点赞视频数据/Get all liked video data on the user's homepage
13792 print (" Running test : API.get_douyin_profile_liked_videos()" )
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 ' )
93+ r = await api.get_douyin_profile_liked_videos(douyin_user_url, cursor = None , count = None , get_all = False )
94+ print (f ' Get { len (r)} liked videos from profile ' )
95+
96+ # 获取抖音视频的所有评论数据/Get all comment data of Douyin video
97+ print (" Running test : API.get_douyin_video_comments()" )
98+ r = await api.get_douyin_video_comments(douyin_url, cursor = None , count = None , get_all = False )
99+ print (f ' Get { len (r)} comments from video ' )
140100
141101 # 总耗时/Total time
142102 total_time = round (time.time() - start_time, 2 )
@@ -145,9 +105,10 @@ async def async_test() -> None:
145105
146106if __name__ == ' __main__' :
147107 api = API(
148- username = ' test ' ,
149- password = ' test ' ,
108+ email = ' EMAIL@EXAMPLE.COM ' ,
109+ password = ' PASSWORD ' ,
150110 proxy = None ,
151111 )
152112 asyncio.run(async_test())
113+
153114```
0 commit comments