2022-12-02 02:45:37 -08:00
2022-12-02 02:45:37 -08:00
2021-11-18 15:07:12 -08:00
2022-09-05 15:29:50 -07:00
2022-11-14 17:40:40 -08:00
2022-05-20 16:35:30 -07:00
2021-11-06 18:35:09 -07:00
2022-11-09 16:59:59 -08:00
2022-08-29 16:02:58 -07:00
2022-08-22 15:39:08 +08:00
2021-11-06 18:35:09 -07:00
2022-04-06 10:48:05 -07:00
2022-11-20 03:47:01 -08:00
2022-11-13 16:39:04 -08:00
2022-12-02 01:55:11 -08:00
2022-10-17 21:08:10 -07:00
2022-11-13 16:10:34 -08:00
2022-11-09 19:19:07 -08:00

Douyin_TikTok_Download_API(抖音/TikTok API)

English|Simplified Chinese

🚀「Douyin_TikTok_Download_API」is an out-of-the-box high-performance asynchronousTik Tok|TikTokData crawling tool, supports API call, online batch analysis and download.

GitHub licenseRelease VersionGitHub StarGitHub ForkGitHub issuesGitHub closed issuesGitHub Repo size
PyPI vPyPI wheelPyPI dmPyPI pyversions
API-V1 statusAPI-V2 status
爱发电KofiPatreon

👻 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 onPyWebIOFastAPIAIOHTTP, fast asynchronousTik Tok/TikTokIt 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 projectscraper.pyor install an existingpip packageAs a parsing library, it is easy to crawl data, etc...

Some simple application scenarios:

Download prohibited videos for data analysis, download without watermark for iOS (withiOS built-in shortcut command APPCooperate with the API of this project to realize in-app download or read clipboard download), etc.....

🖥Public site: I'm fragile...don't stress test (••᷄ࡇ•᷅

**API-V2:**support inputDouyin|TikTokCrawl the author from the user homepage [homepage video data (remove watermark link, liked video list (permission must be public), video comment data, background music video list data, etc...), please refer to the V2 document for details , the server response time sometimes becomes longer, please set thetimeoutSet 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 by 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 useScraper()The class processes the data and returns it in the form of JSON, video downloads, quick calls with iOS shortcuts, and asynchronous support.

web_app.py:

  • forweb_api.pyas well asscraper.pyA simple web program made to process the value entered in the web page and then use itScraper()class processing and matchingweb_api.pyThe interface output is on the webpage (similar to the separation of front and back ends)

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)

Features:

  • Douyin (overseas version of Douyin: TikTok) video/picture analysis
  • Batch analysis on the web page (supports Douyin/TikTok mixed submission)
  • Batch download of videos without watermark on the analysis result page of the web page (V3.0.0 is temporarily removed, please deploy V2.X version by yourself)
  • API call to get link data
  • makepip packageEasily and quickly import your projects
  • iOS shortcut command to quickly call APIRealize in-app download without watermark video/photo gallery
  • Parse all videos on the author's homepage (API-V2Support Douyin/TikTok)
  • Parse all comment information in the video (API-V2Support Douyin/TikTok)

🤦To-do list:

💡Welcome to make new suggestions or share your ideas with me in issue, or submit PR directly toDevelopment branch♪(・ω・)ノ)

  • Write a desktop downloader to realize local batch download
  • API-V2 adds data crawling for hash_tag pages#101
  • Add support for other short video platforms, such as: Douyin Volcano, Kuaishou, Watermelon Video, Bilibili

📦Call the parsing library:

💡PyPi:https://pypi.org/project/douyin-tiktok-scraper/

Install the parsing library:pip install douyin-tiktok-scraper

import asyncio
from douyin_tiktok_scraper.scraper import Scraper

api = Scraper()

async def hybrid_parsing(url: str) -> dict:
    # Hybrid parsing(Douyin/TikTok URL)
    result = await api.hybrid_parsing(url)
    print(f"The hybrid parsing result:\n {result}")
    return result

asyncio.run(hybrid_parsing(url=input("Paste Douyin/TikTok share URL here: ")))

🗺️Supported submission formats:

💡Tips: Including but not limited to the following examples, if you encounter link parsing failures, please open a new oneissue

  • Douyin sharing 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 (copy in APP)
https://www.tiktok.com/t/ZTR9nDNWq/
  • TikTok normal URL (web version copy)
https://www.tiktok.com/@evil0ctal/video/7156033831819037994
  • Douyin/TikTok bulk URLs (no need to use symbols to separate)
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:

For more demos, please check the content of the document...

💻 Deployment (method 1 Linux)

💡Tips: It is best to deploy this project to a server in the United States, otherwise strange bugs may appear.

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

🔎点击展开截图

Douyin official API:

API of this project:

TikTok official API:

API of this project:


Project interface

🔎点击展开截图

Web main interface:

Web main interface:


📜 Star History

Star History Chart

MY License

Start: 2021/11/06 GitHub:@Evil0ctalContact:Evil0ctal1985@gmail.com

Description
🚀「Douyin_TikTok_Download_API」是一个开箱即用的高性能异步抖音、快手、TikTok、Bilibili数据爬取工具,支持API调用,在线批量解析及下载。
Readme Apache-2.0 9.2 MiB
Languages
Python 98.8%
Shell 1%
Dockerfile 0.2%