Skip to content

Commit 9545f05

Browse files
committed
Build V1.0.0
1 parent e0aa715 commit 9545f05

15 files changed

+666
-4
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ __pycache__/
1010
.Python
1111
build/
1212
develop-eggs/
13-
dist/
1413
downloads/
1514
eggs/
1615
.eggs/

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/GitLink.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/TikHub_PyPi.iml

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 98 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/profiles_settings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 84 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
| 🔜 | SOON符 - 功能已提出但尚未分配指定开发人员。|
1616
| ⚠️ | 警告符 - 功能出现问题待修复。|
1717

18-
### 项目进度
18+
## 项目进度
1919

2020
| 状态 | API端点路径 | 功能 |
2121
| :---: | :---: | :---: |
@@ -52,6 +52,87 @@
5252
| 🚀 | `/tiktok_profile_videos/` | 爬取用户主页视频数据 | 无已知问题 |
5353
| 🚀 | `/tiktok_profile_liked_videos/` | 爬取用户主页已点赞视频数据 | 无已知问题 |
5454

55-
## 1. 制作待办事宜 `Todo` 列表
55+
## 待办事宜 `Todo` 列表
5656

57-
- [ ] 🎉 修复失效端点
57+
- [ ] ⚠️ 修复`/douyin_video_comments/`端点
58+
- [ ] ⚠️ 修复`/douyin_music_videos/`端点
59+
60+
## 使用示例
61+
62+
```python
63+
async def async_test() -> None:
64+
# 异步测试/Async test
65+
66+
tiktok_url = 'https://www.tiktok.com/@evil0ctal/video/7156033831819037994'
67+
68+
tiktok_music_url = 'https://www.tiktok.com/music/original-sound-7128362040359488261'
69+
70+
douyin_url = 'https://www.douyin.com/video/7153585499477757192'
71+
72+
douyin_user_url = 'https://www.douyin.com/user/MS4wLjABAAAA-Hu1YKTuhE3QkCHD5yU26k--RUZiaoMRtpfmeid-Z_o'
73+
74+
print("Test start...\n")
75+
start_time = time.time()
76+
77+
# 获取TikHub请求头/Get TikHub request header
78+
print("Running test : API.authenticate()")
79+
await api.authenticate()
80+
81+
# 获取TikHub用户信息/Get TikHub user information
82+
print("Running test : API.get_user_info()")
83+
await api.get_user_info()
84+
85+
print("\nRunning ALL TikTok methods test...\n")
86+
87+
# 获取单个视频数据/Get single video data
88+
print("Running test : API.get_tiktok_video_data()")
89+
await api.get_tiktok_video_data(tiktok_url)
90+
91+
# 获取获取用户主页的所有视频数据/Get all video data on the user's homepage
92+
print("Running test : API.get_tiktok_profile_videos()")
93+
aweme_list = await api.get_tiktok_profile_videos(tiktok_url, 20)
94+
print(f'Get {len(aweme_list)} videos from profile')
95+
96+
# 获取用户主页的所有点赞视频数据/Get all liked video data on the user's homepage
97+
print("Running test : API.get_tiktok_profile_liked_videos()")
98+
aweme_list = await api.get_tiktok_profile_liked_videos(tiktok_url, 20)
99+
print(f'Get {len(aweme_list)} liked videos from profile')
100+
101+
# 获取TikTok视频的所有评论数据/Get all comment data of TikTok video
102+
print("Running test : API.get_tiktok_video_comments()")
103+
comments_list = await api.get_tiktok_video_comments(tiktok_url, 20)
104+
print(f'Get {len(comments_list)} comments from video')
105+
106+
# 获取音乐页面上的所有(理论上能抓取到的)视频数据/Get all (theoretically) video data on the music page
107+
print("Running test : API.get_tiktok_music_videos()")
108+
aweme_list = await api.get_tiktok_music_videos(tiktok_music_url, 20)
109+
print(f'Get {len(aweme_list)} videos from music')
110+
111+
print("\nRunning ALL Douyin methods test...\n")
112+
113+
# 获取单个视频数据/Get single video data
114+
print("Running test : API.get_douyin_video_data()")
115+
await api.get_douyin_video_data(douyin_url)
116+
117+
# 获取获取用户主页的所有视频数据/Get all video data on the user's homepage
118+
print("Running test : API.get_douyin_profile_videos()")
119+
aweme_list = await api.get_douyin_profile_videos(douyin_user_url, 20)
120+
print(f'Get {len(aweme_list)} videos from profile')
121+
122+
# 获取用户主页的所有点赞视频数据/Get all liked video data on the user's homepage
123+
print("Running test : API.get_douyin_profile_liked_videos()")
124+
aweme_list = await api.get_douyin_profile_liked_videos(douyin_user_url, 20)
125+
126+
# 总耗时/Total time
127+
total_time = round(time.time() - start_time, 2)
128+
print("\nTest completed, total time: {}s".format(total_time))
129+
130+
131+
if __name__ == '__main__':
132+
api = API(
133+
username='test',
134+
password='test',
135+
proxy=None,
136+
)
137+
asyncio.run(async_test())
138+
```

dist/tikhub-1.0.0-py3-none-any.whl

10.2 KB
Binary file not shown.

dist/tikhub-1.0.0.tar.gz

10.4 KB
Binary file not shown.

setup.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#! /usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
# RUN Command Line:
4+
# 1.Build-check dist folder
5+
# python setup.py sdist bdist_wheel
6+
# 2.Upload to PyPi
7+
# twine upload dist/*
8+
9+
import setuptools
10+
11+
with open("README.md", "r", encoding='utf8') as fh:
12+
long_description = fh.read()
13+
14+
setuptools.setup(
15+
name='tikhub',
16+
author='TikHub.io',
17+
version='1.0.0',
18+
license='Apache V2.0 License',
19+
description='Douyin/TikTok async data scraper.',
20+
long_description=long_description,
21+
long_description_content_type="text/markdown",
22+
author_email='tikhub.io@proton.me',
23+
url='https://github.com/orgs/TikHubIO',
24+
packages=setuptools.find_packages(),
25+
keywords='TikTok, Douyin, 抖音, Scraper, Crawler, API, Download, Video, No Watermark, Async',
26+
# 依赖包
27+
install_requires=[
28+
'aiohttp',
29+
"tenacity",
30+
],
31+
classifiers=[
32+
"Programming Language :: Python :: 3",
33+
"Programming Language :: Python :: 3.6",
34+
"Programming Language :: Python :: 3.7",
35+
"Programming Language :: Python :: 3.8",
36+
"Programming Language :: Python :: 3.9",
37+
"Programming Language :: Python :: 3.10",
38+
"Programming Language :: Python :: 3 :: Only",
39+
],
40+
python_requires='>=3.6',
41+
)

tikhub/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)