14 KiB
Douyin_TikTok_Download_API(抖音/TikTok无水印解析API)
📝运行说明 • 👽️API使用 • 🔧手动部署 • 🚧Docker部署 • 📦️Docker镜像 • 🧑💻贡献者
Language: [English] [Simplified Chinese]
👻Introduction
🚨If you need to use a private server to run this project, please refer to the deployment method[Docker deployment,Manual deployment]
This project is based onPyWebIO,FastAPI,AIOHTTP, fast asynchronousTik Tok/TikTokData crawling tool, and realize online batch parsing and download of watermark-free videos or atlases 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 projectscraper.pyor install an existingpip packageAs a parsing library to easily crawl data, etc...
Some simple application scenarios:
Download prohibited videos, perform data analysis, and download without watermark on iOS (withShortcut APP that comes with iOSCooperate with the API of this project to realize in-app download or read clipboard download), etc...
🖥Public Site: I'm vulnerable...please don't hit me at will (·•᷄ࡇ•᷅ )
**API-V2:**support input
Douyin|TikTok
The user's homepage crawls the author [homepage video data (remove watermark link, liked video list (permission must be public), video comment data, background music video list data, etc...), please check the V2 document for details , the server response time may sometimes become longer, pleasetimeout
Set the value high.
🍔Web APP:https://douyin.wtf/
🍟API-V1:https://api.douyin.wtf/docs
🌭API-V2:https://api-v2.douyin.wtf/docs
💾iOS Shortcut:Shortcut release
📦️ Desktop downloader (recommended warehouse):
⚗️Technology stack
scraper.py:
- Towards[Douyin|TikTok]The API submits requests and retrieves data, returns a dictionary (dict) after processing, and supports asynchronous.
web_api.py:
- get request parameters and use
Scraper()
After the class processes the data, it returns it in the form of JSON, and the video is downloaded. It can be called quickly with the iOS shortcut command, and supports asynchronous.
web_app.py:
- for
web_api.py
as well asscraper.py
Created a simple web program that processes the value entered on the web page and uses itScraper()
Class handling and coordinationweb_api.py
The interface output is on the web page (similar to front-end and back-end separation)
Most of the parameters of the above files can be found inconfig.inimake changes in
💡Project file structure
.
└── Douyin_TikTok_Download_API/
├── /static -> (PyWebIO static resources)
├── web_app.py -> (Web APP)
├── web_api.py -> (API)
├── scraper.py -> (Parsing library)
├── config.ini -> (configuration file)
💯 Supported features:
- Douyin (Douyin overseas version: TikTok) video/picture analysis
- Batch parsing on the webpage (support Douyin/TikTok mixed submission)
- Batch download of watermark-free videos on the web-side parsing result page (Temporarily removed for V3.0.0)
- API call to get link data
- makepip packageEasily and quickly import your projects
- iOS shortcut command to quickly call APIRealize in-app download of video/atlas without watermark
- Parse all videos in the author's homepage (API-V2Support Douyin/TikTok)
- Parse all comments in the video (API-V2Support Douyin/TikTok)
🤦Follow-up features:
- Welcome to make new suggestions or share your ideas with me in the issue
- Welcome to submit PR toDevelopment branch♪(・ω・)ノ)
📦 Call parsing library:
Install the parsing library:pip install douyin-tiktok-scraper
import asyncio
from douyin_tiktok_scraper.scraper import Scraper
api = Scraper()
async def async_test(url: str) -> dict:
# Hybrid parsing(Douyin/TikTok URL)
hybrid_data = await api.hybrid_parsing(url)
print(f"The hybrid parsing result:\n {hybrid_data}")
return hybrid_data
asyncio.run(async_test(url=input("Paste Douyin/TikTok share URL here: ")))
🗺️ Supported submission formats:
💡Tip: Including but not limited to the following examples, if you encounter link resolution failure, please open a new oneissue
- Douyin share password (copy in APP)
7.43 pda:/ 让你在几秒钟之内记住我 https://v.douyin.com/L5pbfdP/ 复制此链接,打开Dou音搜索,直接观看视频!
- Douyin Short URL (Copy in APP)
https://v.douyin.com/L4FJNR3/
- Douyin normal URL (web version copy)
https://www.douyin.com/video/6914948781100338440
- Douyin discovery page URL (APP copy)
https://www.douyin.com/discover?modal_id=7069543727328398622
- TikTok Short URL (In-App Copy)
https://www.tiktok.com/t/ZTR9nDNWq/
- TikTok normal URL (copy from web version)
https://www.tiktok.com/@evil0ctal/video/7156033831819037994
- Douyin/TikTok bulk URLs (no need to separate them)
https://v.douyin.com/L4NpDJ6/
https://www.douyin.com/video/7126745726494821640
2.84 nqe:/ 骑白马的也可以是公主%%百万转场变身https://v.douyin.com/L4FJNR3/ 复制此链接,打开Dou音搜索,直接观看视频!
https://www.tiktok.com/t/ZTR9nkkmL/
https://www.tiktok.com/t/ZTR9nDNWq/
https://www.tiktok.com/@evil0ctal/video/7156033831819037994
🛰️API Documentation
💡Tip: You can also view the interface documentation in the code comments of web_api.py
**API-V1 Documentation:**local:http://localhost:8000/docsOnline:https://api.douyin.wtf/docs
**API-V2 Documentation:**Online:https://api-v2.douyin.wtf/docs
API demo:
-
Crawl video data (TikTok or Douyin mixed analysis)
https://api.douyin.wtf/api?url=[视频链接/Video URL]&minimal=false
-
Download video/photo gallery (TikTok or Douyin mixed analysis)
https://api.douyin.wtf/download?url=[视频链接/Video URL]&prefix=true&watermark=false
-
Replace the domain name to download videos/atlas
[抖音] 原始链接: https://www.douyin.com/video/7159502929156705567 替换域名: https://api.douyin.wtf/video/7159502929156705567
返回无水印视频下载响应
[TikTok] original link: https://www.tiktok.com/@evil0ctal/video/7156033831819037994 Replace Domain: https://api.douyin.wtf/@evil0ctal/video/7156033831819037994
Return No Watermark Video Download Response
Check out the documentation for more demos...
💻Deployment (Method 1 Linux)
💡Tip: It is best to deploy this project to a server in the United States, otherwise strange bugs may occur.
-
First go to the security group to open ports 8080 (Web) and 8000 (API).
-
Search in the Pagoda Panel App Store
进程守护
or install manuallysupervisord
:[宝塔面板] https://www.bt.cn/new/download.html [aapanel] https://www.aapanel.com/new/download.html [Supervisor] http://supervisord.org/installing.html
-
configuration itemconfig.inidocument
-
Install dependencies
pip install -r requirements.txt
-
set up
supervisord
daemon -
Start command:
[Web]
python3 web_app.py
[API]
python3 web_api.py
- Program entry:
[Web]
http://localhost:8080
[API]
http://localhost:8000
💽Deployment (Method 2 Docker)
💡Docker Image repo:Docker Hub
- install docker
curl -fsSL get.docker.com -o get-docker.sh&&sh get-docker.sh &&systemctl enable docker&&systemctl start docker
- Just leave the config.int and docker-compose.yml files
- Run the command to let the container run in the background
docker compose up -d
- View container logs
docker logs -f douyin_tiktok_download_api
- delete container
docker rm -f douyin_tiktok_download_api
- renew
docker compose pull && docker compose down && docker compose up -d
❤️ Contributors
📸 Screenshot
API speed test (compared to official API)
Project interface
🔎点击展开截图
Web主界面: 📜 Star History
Start: 2021/11/06 GitHub:@Evil0ctalContact:Evil0ctal1985@gmail.com