Merge remote-tracking branch 'origin/main'

This commit is contained in:
Evil0ctal 2022-12-21 22:37:13 -08:00
commit ae856c0196
2 changed files with 93 additions and 50 deletions

View File

@ -15,13 +15,13 @@
## 👻 Introduction ## 👻 Introduction
> 🚨If you need to use a private server to run this project, please refer to the deployment method\[[Docker deployment](./README.md#%E9%83%A8%E7%BD%B2%E6%96%B9%E5%BC%8F%E4%BA%8C-docker),[manual deployment](./README.md#%E9%83%A8%E7%BD%B2%E6%96%B9%E5%BC%8F%E4%B8%80-linux)] > 🚨If you need to use a private server to run this project, please refer to the deployment method\[[Docker deployment](./README.md#%E9%83%A8%E7%BD%B2%E6%96%B9%E5%BC%8F%E4%BA%8C-docker),[One-click deployment](./README.md#%E9%83%A8%E7%BD%B2%E6%96%B9%E5%BC%8F%E4%B8%80-linux)]
This project is based on[PyWebIO](https://github.com/pywebio/PyWebIO)[FastAPI](https://fastapi.tiangolo.com/)[AIOHTTP](https://docs.aiohttp.org/), fast asynchronous[Tik Tok](https://www.douyin.com/)/[TikTok](https://www.tiktok.com/)It is a data crawling tool, and realizes online batch analysis and download of video or atlas without watermark through the web terminal, data crawling API, iOS shortcut command without watermark download and other functions. You can deploy or transform this project yourself to achieve more functions, or you can call it directly in your project[scraper.py](https://github.com/Evil0ctal/Douyin_TikTok_Download_API/blob/Stable/scraper.py)or install an existing[pip package](https://pypi.org/project/douyin-tiktok-scraper/)As a parsing library, it is easy to crawl data, etc... This project is based on[PyWebIO](https://github.com/pywebio/PyWebIO)[FastAPI](https://fastapi.tiangolo.com/)[AIOHTTP](https://docs.aiohttp.org/), fast asynchronous[Tik Tok](https://www.douyin.com/)/[TikTok](https://www.tiktok.com/)It is a data crawling tool, and realizes online batch analysis and download of video or atlas without watermark through the web terminal, data crawling API, iOS shortcut command without watermark download and other functions. You can deploy or transform this project yourself to achieve more functions, or you can call it directly in your project[scraper.py](https://github.com/Evil0ctal/Douyin_TikTok_Download_API/blob/Stable/scraper.py)or install an existing[pip package](https://pypi.org/project/douyin-tiktok-scraper/)As a parsing library, it is easy to crawl data, etc...
_Some simple application scenarios:_ _Some simple application scenarios:_
_Download prohibited videos for data analysis, download without watermark for iOS (with[iOS built-in shortcut command APP](https://apps.apple.com/cn/app/%E5%BF%AB%E6%8D%B7%E6%8C%87%E4%BB%A4/id915249334)Cooperate with this project API to realize in-app download or read clipboard download), etc....._ _Download prohibited videos for data analysis, download without watermark for iOS (with[iOS built-in shortcut command APP](https://apps.apple.com/cn/app/%E5%BF%AB%E6%8D%B7%E6%8C%87%E4%BB%A4/id915249334)Cooperate with the API of this project to realize in-app download or read clipboard download), etc....._
## 🖥Public site: I'm vulnerable...don't stress test (••᷄ࡇ•᷅ ## 🖥Public site: I'm vulnerable...don't stress test (••᷄ࡇ•᷅
@ -94,7 +94,7 @@ _Download prohibited videos for data analysis, download without watermark for iO
* * * * * *
## 📦Calling the parsing library: ## 📦Call the parsing library:
> 💡PyPi<https://pypi.org/project/douyin-tiktok-scraper/> > 💡PyPi<https://pypi.org/project/douyin-tiktok-scraper/>
@ -206,36 +206,57 @@ online:<https://api-v2.douyin.wtf/docs>
> 💡Tips: It is best to deploy this project to a server in the United States, otherwise strange bugs may appear. > 💡Tips: It is best to deploy this project to a server in the United States, otherwise strange bugs may appear.
- First go to the security group to open ports 8080 (Web) and 8000 (API). recommend everyone to use[Digitalocean](https://www.digitalocean.com/)The server, mainly because it is free.
- Search in the Pagoda panel app store`进程守护`or install manually`supervisord`
使用我的邀请链接注册,你可以获得$200的credit当你在上面消费$25时我也可以获得$25的奖励。
My invite link:
<https://m.do.co/c/9f72a27dec35>
> Use the script to deploy this project with one click
- Download using wget command[install.sh](https://raw.githubusercontent.com/Evil0ctal/Douyin_TikTok_Download_API/main/install.sh)to server
[宝塔面板] wget https://raw.githubusercontent.com/Evil0ctal/Douyin_TikTok_Download_API/main/install.sh
https://www.bt.cn/new/download.html
[aapanel]
https://www.aapanel.com/new/download.html
[Supervisor]
http://supervisord.org/installing.html
- configuration items[config. ini](https://github.com/Evil0ctal/Douyin_TikTok_Download_API/blob/main/config.ini)document - Execute with root privileges after the download is complete
- Install dependencies`pip install -r requirements.txt`
- set up`supervisord`daemon process
- Start command: sudo sh install.sh
- Automatically used after running the Bash script[config.py](https://github.com/Evil0ctal/Douyin_TikTok_Download_API/blob/main/config.py)to help you modify[config. ini](https://github.com/Evil0ctal/Douyin_TikTok_Download_API/blob/main/config.ini)
```console ```console
[Web] Please edit config.ini, all input must be numbers!
python3 web_app.py Default API port: 8000
[API] If you want use different port input new API port here: 80
python3 web_api.py Use new port for web_api.py: 80
Default API rate limit: 10/minute
If you want use different rate limit input new rate limit here: 60
Use new rate limit: 60/minute
Default App port: 80
If you want use different port input new App port here: 8080
Use new port: 8080
``` ```
- Program entry: - The script will then ask you which services you want to start
```text api: started separately`web_api.py`
[Web]
http://localhost:8080 web: started separately`web_app.py`
[API]
http://localhost:8000 all: start at the same time`web_api.py`with`web_app.py`
```console
Run API or Web? [api/web/all/quit] api
Do you want to start the api service when system boot? [y/n] y
Created symlink /etc/systemd/system/multi-user.target.wants/web_api.service → /etc/systemd/system/web_api.service.
API service will start when system boot!
Starting API...
API is running! You can visit http://your_ip:port
You can stop the api service by running: systemctl stop web_api.service
``` ```
## 💽Deployment (Method 2 Docker) ## 💽Deployment (Method 2 Docker)
@ -279,7 +300,7 @@ docker compose pull && docker compose down && docker compose up -d
## 📸Screenshot ## 📸Screenshot
**_API速度测试(对比官方API)_** **_API speed test (compared to official API)_**
<details><summary>🔎点击展开截图</summary> <details><summary>🔎点击展开截图</summary>

View File

@ -6,7 +6,7 @@
<div align="center"> <div align="center">
[English](./README.en.md) | [简体中文](./README.md) [English](./README.en.md) | [简体中文](./README.md)
🚀「Douyin_TikTok_Download_API」是一个开箱即用的高性能异步[抖音](https://www.douyin.com)|[TikTok](https://www.tiktok.com)数据爬取工具支持API调用在线批量解析及下载。 🚀「Douyin_TikTok_Download_API」是一个开箱即用的高性能异步[抖音](https://www.douyin.com)|[TikTok](https://www.tiktok.com)数据爬取工具支持API调用在线批量解析及下载。
[![GitHub license](https://img.shields.io/github/license/Evil0ctal/Douyin_TikTok_Download_API?style=flat-square)](LICENSE) [![GitHub license](https://img.shields.io/github/license/Evil0ctal/Douyin_TikTok_Download_API?style=flat-square)](LICENSE)
@ -33,7 +33,7 @@
## 👻介绍 ## 👻介绍
> 🚨如需使用私有服务器运行本项目,请参考部署方式[[Docker部署](./README.md#%E9%83%A8%E7%BD%B2%E6%96%B9%E5%BC%8F%E4%BA%8C-docker), [手动部署](./README.md#%E9%83%A8%E7%BD%B2%E6%96%B9%E5%BC%8F%E4%B8%80-linux)] > 🚨如需使用私有服务器运行本项目,请参考部署方式[[Docker部署](./README.md#%E9%83%A8%E7%BD%B2%E6%96%B9%E5%BC%8F%E4%BA%8C-docker), [一键部署](./README.md#%E9%83%A8%E7%BD%B2%E6%96%B9%E5%BC%8F%E4%B8%80-linux)]
本项目是基于 [PyWebIO](https://github.com/pywebio/PyWebIO)[FastAPI](https://fastapi.tiangolo.com/)[AIOHTTP](https://docs.aiohttp.org/),快速异步的[抖音](https://www.douyin.com/)/[TikTok](https://www.tiktok.com/)数据爬取工具并通过Web端实现在线批量解析以及下载无水印视频或图集数据爬取APIiOS快捷指令无水印下载等功能。你可以自己部署或改造本项目实现更多功能也可以在你的项目中直接调用[scraper.py](https://github.com/Evil0ctal/Douyin_TikTok_Download_API/blob/Stable/scraper.py)或安装现有的[pip包](https://pypi.org/project/douyin-tiktok-scraper/)作为解析库轻松爬取数据等..... 本项目是基于 [PyWebIO](https://github.com/pywebio/PyWebIO)[FastAPI](https://fastapi.tiangolo.com/)[AIOHTTP](https://docs.aiohttp.org/),快速异步的[抖音](https://www.douyin.com/)/[TikTok](https://www.tiktok.com/)数据爬取工具并通过Web端实现在线批量解析以及下载无水印视频或图集数据爬取APIiOS快捷指令无水印下载等功能。你可以自己部署或改造本项目实现更多功能也可以在你的项目中直接调用[scraper.py](https://github.com/Evil0ctal/Douyin_TikTok_Download_API/blob/Stable/scraper.py)或安装现有的[pip包](https://pypi.org/project/douyin-tiktok-scraper/)作为解析库轻松爬取数据等.....
@ -230,37 +230,59 @@ https://api.douyin.wtf/@evil0ctal/video/7156033831819037994
> 💡提示最好将本项目部署至美国地区的服务器否则可能会出现奇怪的BUG。 > 💡提示最好将本项目部署至美国地区的服务器否则可能会出现奇怪的BUG。
- 首先要去安全组开放8080(Web)和8000(API)端口。 推荐大家使用[Digitalocean](https://www.digitalocean.com/)的服务器,主要是因为免费。
- 在宝塔面板应用商店内搜索`进程守护`或手动安装`supervisord`
使用我的邀请链接注册,你可以获得$200的credit当你在上面消费$25时我也可以获得$25的奖励。
我的邀请链接:
[https://m.do.co/c/9f72a27dec35](https://m.do.co/c/9f72a27dec35)
> 使用脚本一键部署本项目
- 使用wget命令下载[install.sh](https://raw.githubusercontent.com/Evil0ctal/Douyin_TikTok_Download_API/main/install.sh)至服务器
``` ```
[宝塔面板] wget https://raw.githubusercontent.com/Evil0ctal/Douyin_TikTok_Download_API/main/install.sh
https://www.bt.cn/new/download.html
[aapanel]
https://www.aapanel.com/new/download.html
[Supervisor]
http://supervisord.org/installing.html
``` ```
- 配置项目[config.ini](https://github.com/Evil0ctal/Douyin_TikTok_Download_API/blob/main/config.ini)文件 - 下载完成后使用root权限执行
- 安装依赖文件`pip install -r requirements.txt`
- 设置`supervisord`守护进程 ```
- 启动命令: sudo sh install.sh
```
- 运行Bash脚本后会自动使用[config.py](https://github.com/Evil0ctal/Douyin_TikTok_Download_API/blob/main/config.py)来帮助你修改[config.ini](https://github.com/Evil0ctal/Douyin_TikTok_Download_API/blob/main/config.ini)
```console ```console
[Web] Please edit config.ini, all input must be numbers!
python3 web_app.py Default API port: 8000
[API] If you want use different port input new API port here: 80
python3 web_api.py Use new port for web_api.py: 80
Default API rate limit: 10/minute
If you want use different rate limit input new rate limit here: 60
Use new rate limit: 60/minute
Default App port: 80
If you want use different port input new App port here: 8080
Use new port: 8080
``` ```
- 程序入口: - 随后脚本会询问你要启动的服务
```text api单独启动`web_api.py`
[Web]
http://localhost:8080 web单独启动`web_app.py`
[API]
http://localhost:8000 all同时启动`web_api.py``web_app.py`
```console
Run API or Web? [api/web/all/quit] api
Do you want to start the api service when system boot? [y/n] y
Created symlink /etc/systemd/system/multi-user.target.wants/web_api.service → /etc/systemd/system/web_api.service.
API service will start when system boot!
Starting API...
API is running! You can visit http://your_ip:port
You can stop the api service by running: systemctl stop web_api.service
``` ```
## 💽部署(方式二 Docker) ## 💽部署(方式二 Docker)