Skip to content

Commit

Permalink
docs: Added README."en".md translation via https://github.com/dephrai…
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Feb 23, 2023
1 parent c8f9eea commit 47b19df
Showing 1 changed file with 37 additions and 76 deletions.
113 changes: 37 additions & 76 deletions README.en.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div align="center">

# [tikhub_pp](https://pypi.org/project/tikhub)
# [tikhub_op_pp](https://pypi.org/project/tikhub)

[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.

Expand All @@ -10,69 +10,21 @@ Pee:<https://pypi.org/project/tikhub>

</div>

## note
## 使用示例

> This project uses the following Emoji to indicate the development status in the development chart!
> Check[test.py](https://github.com/TikHubIO/TikHub_PyPi/blob/main/test/test.py)
| Emoji | representative meaning |
| :---: | :-------------------------------------------------------------------------------------------------------------------: |
| 🚀 | Rocket - The feature is written, tested, and deployed to production. |
|| Check mark - the feature is written, but has yet to be tested and will be deployed to production once the tests pass. |
|| Cross sign - The feature has not yet been written or has not been written yet. |
| 🔜 | SOON BREAK - Feature proposed but not yet assigned a designated developer. |
| ⚠️ | Warning symbol - There is a problem with the function that needs to be fixed. |
- Install

## project progress

| state | API endpoint path | Function |
| :---: | :---------------: | :--------------------: |
| 🚀 | `/token` | generate`Bearer Token` |
| 🚀 | `/users/me/` | Get user information |

> Requirements for each interface endpoint
| state | support platform | need | start date | ETA date | Developer |
| :---: | :--------------- | :----------------------------------------------: | :--------: | :-------: | :--------: |
| 🚀 | Douyin, TikTok | Crawl a single video data | 2022/10/08 | completed | @Evil0ctal |
| 🚀 | Douyin, TikTok | Crawl a single video comment data | 2022/10/08 | completed | @Evil0ctal |
| 🚀 | Douyin, TikTok | Crawl the soundtrack data | 2022/10/08 | completed | @Evil0ctal |
| 🚀 | Douyin, TikTok | Crawl user homepage video data | 2022/10/08 | completed | @Evil0ctal |
| 🚀 | Douyin, TikTok | Crawl the user homepage has liked the video data | 2022/10/08 | completed | @Evil0ctal |

> Production and deployment of Douyin-related interfaces - API tags: Douyin
| state | API endpoint path | Function | issue |
| :---: | :-----------------------------: | :----------------------------------------------: | :-------------------: |
| 🚀 | `/douyin_video_data/` | Crawl a single video data | no known issues |
| ⚠️ | `/douyin_video_comments/` | Crawl a single video comment data | Invalid to be updated |
| ⚠️ | `/douyin_music_videos/` | Crawl the soundtrack data | Invalid to be updated |
| 🚀 | `/douyin_profile_videos/` | Crawl user homepage video data | no known issues |
| 🚀 | `/douyin_profile_liked_videos/` | Crawl the user homepage has liked the video data | no known issues |

> Production deployment of TikTok-related interfaces - API tags: TikTok
| state | API endpoint path | Function | issue |
| :---: | :-----------------------------: | :----------------------------------------------: | :-------------: |
| 🚀 | `/tiktok_video_data/` | Crawl a single video data | no known issues |
| 🚀 | `/tiktok_video_comments/` | Crawl a single video comment data | no known issues |
| 🚀 | `/tiktok_music_videos/` | Crawl the soundtrack data | no known issues |
| 🚀 | `/tiktok_profile_videos/` | Crawl user homepage video data | no known issues |
| 🚀 | `/tiktok_profile_liked_videos/` | Crawl the user homepage has liked the video data | no known issues |

## to do`Todo`the list

- [ ] ⚠️ fix`/douyin_video_comments/`endpoint
- [ ] ⚠️ fix`/douyin_music_videos/`endpoint

## Example of use
```bash
pip install tikhub
```

> Check[demo.py](https://github.com/TikHubIO/TikHub_PyPi/blob/main/demo/demo.py)
- Usage

```python
import asyncio
import time
from tikhub.api import *

from tikhub.api import API

async def async_test() -> None:
# 异步测试/Async test
Expand All @@ -89,54 +41,62 @@ async def async_test() -> None:
start_time = time.time()

# 获取TikHub请求头/Get TikHub request header
print("Running test : API.authenticate()")
await api.authenticate()
r = await api.user_login()
print("Running test : API.user_login()")
print(r)

# 获取TikHub用户信息/Get TikHub user information
print("Running test : API.get_user_info()")
await api.get_user_info()
r = await api.get_user_info()
print(r)

print("\nRunning ALL TikTok methods test...\n")

# 获取单个视频数据/Get single video data
print("Running test : API.get_tiktok_video_data()")
await api.get_tiktok_video_data(tiktok_url)
r = await api.get_tiktok_video_data(tiktok_url)
# print(r)

# 获取获取用户主页的所有视频数据/Get all video data on the user's homepage
print("Running test : API.get_tiktok_profile_videos()")
aweme_list = await api.get_tiktok_profile_videos(tiktok_url, 20)
print(f'Get {len(aweme_list)} videos from profile')
r = await api.get_tiktok_profile_videos(tiktok_url, cursor=None, count=None, get_all=False)
print(f'Get {len(r)} videos from profile')

# 获取用户主页的所有点赞视频数据/Get all liked video data on the user's homepage
print("Running test : API.get_tiktok_profile_liked_videos()")
aweme_list = await api.get_tiktok_profile_liked_videos(tiktok_url, 20)
print(f'Get {len(aweme_list)} liked videos from profile')
r = await api.get_tiktok_profile_liked_videos(tiktok_url, cursor=None, count=None, get_all=False)
print(f'Get {len(r)} liked videos from profile')

# 获取TikTok视频的所有评论数据/Get all comment data of TikTok video
print("Running test : API.get_tiktok_video_comments()")
comments_list = await api.get_tiktok_video_comments(tiktok_url, 20)
print(f'Get {len(comments_list)} comments from video')
r = await api.get_tiktok_video_comments(tiktok_url, cursor=None, count=None, get_all=False)
print(f'Get {len(r)} comments from video')

# 获取音乐页面上的所有(理论上能抓取到的)视频数据/Get all (theoretically) video data on the music page
print("Running test : API.get_tiktok_music_videos()")
aweme_list = await api.get_tiktok_music_videos(tiktok_music_url, 20)
print(f'Get {len(aweme_list)} videos from music')
r = await api.get_tiktok_music_videos(tiktok_music_url, cursor=None, count=None, get_all=False)
print(f'Get {len(r)} videos from music')

print("\nRunning ALL Douyin methods test...\n")

# 获取单个视频数据/Get single video data
print("Running test : API.get_douyin_video_data()")
await api.get_douyin_video_data(douyin_url)
r = await api.get_douyin_video_data(douyin_url)

# 获取获取用户主页的所有视频数据/Get all video data on the user's homepage
print("Running test : API.get_douyin_profile_videos()")
aweme_list = await api.get_douyin_profile_videos(douyin_user_url, 20)
print(f'Get {len(aweme_list)} videos from profile')
r = await api.get_douyin_profile_videos(douyin_user_url, cursor=None, count=None, get_all=False)
print(f'Get {len(r)} videos from profile')

# 获取用户主页的所有点赞视频数据/Get all liked video data on the user's homepage
print("Running test : API.get_douyin_profile_liked_videos()")
aweme_list = await api.get_douyin_profile_liked_videos(douyin_user_url, 20)
print(f'Get {len(aweme_list)} liked videos from profile')
r = await api.get_douyin_profile_liked_videos(douyin_user_url, cursor=None, count=None, get_all=False)
print(f'Get {len(r)} liked videos from profile')

# 获取抖音视频的所有评论数据/Get all comment data of Douyin video
print("Running test : API.get_douyin_video_comments()")
r = await api.get_douyin_video_comments(douyin_url, cursor=None, count=None, get_all=False)
print(f'Get {len(r)} comments from video')

# 总耗时/Total time
total_time = round(time.time() - start_time, 2)
Expand All @@ -145,9 +105,10 @@ async def async_test() -> None:

if __name__ == '__main__':
api = API(
username='test',
password='test',
email='EMAIL@EXAMPLE.COM',
password='PASSWORD',
proxy=None,
)
asyncio.run(async_test())

```

0 comments on commit 47b19df

Please sign in to comment.