2024-04-23 09:29:21 -07:00
2022-12-02 02:45:37 -08:00
2024-04-23 09:29:21 -07:00
2024-04-22 21:38:37 -07:00
2024-04-23 09:29:21 -07:00
2024-04-22 21:29:59 -07:00
2022-09-05 15:29:50 -07:00
2022-11-14 17:40:40 -08:00
2024-04-23 09:29:21 -07:00
2024-04-23 09:29:21 -07:00
2024-04-23 09:29:21 -07:00
2024-04-23 09:29:21 -07:00
2024-04-22 21:02:42 -07:00
2024-04-23 09:29:21 -07:00
2024-04-23 00:35:31 -07:00
2024-04-22 21:02:42 -07:00
2024-04-23 09:29:21 -07:00
2024-04-22 21:29:59 -07:00

Douyin_TikTok_Download_API(抖音/TikTok API)

English|Simplified Chinese

🚀"Douyin_TikTok_Download_API" is a high-performance asynchronous API that can be used out of the boxTik Tok|TikTok|BilibiliData crawling tool supports API calling, online batch analysis and downloading.

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

🔊 V4.0.0 version refactoring

ALL:

  • Removed outdated bilibili code and needs someone to rewrite it.
  • Someone in the group wants to add the analysis of Kuaishou and Xigua videos.
  • The readme is outdated and needs to be rewritten.
  • Make PyPi package
  • The config.yaml file needs to be trimmed.
  • Add parsing of user homepage.
  • iOS shortcuts need to be updated to be compatible with the latest API responses and paths.
  • Desktop downloaders or browser plug-ins can be developed if necessary.
  • Solve the problem of crawler cookie risk control.

Change

  • Run Pywebio as a sub-APP of FastAPI.
  • Rewritten the interfaces of Douyin and TikTok, thank you@johnserf-seed
  • The file download endpoint has been rewritten and now uses asynchronous file IO.
  • Annotations and demonstration values were added to all endpoints.
  • Organize the project file structure.

Remark

If you are interested in writing this project together, please add us on WeChatEvil0ctalNote: Github project reconstruction, everyone can communicate and learn from each other in the group. Advertising and illegal things are not allowed. It is purely for making friends and technical exchanges.

Private interface service

Discord:Tikhub discord

Free Douyin/TikTok API:Tikhub Beta Opi

👻Introduction

🚨If you need to use a private server to run this project, please refer to the deployment method[Docker deployment,One-click deployment]

This project is based onPyWebIOFastAPIHTTPX, fast and asynchronousTik Tok/TikTokData crawling tool, and realizes online batch analysis and downloading of videos or photo albums without watermarks through the Web, data crawling API, iOS shortcut command without watermark downloads and other functions. You can deploy or modify 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, perform data analysis, download without watermark on iOS (withShortcut command APP that comes with iOSCooperate with the API of this project to achieve in-app downloads or read clipboard downloads), etc.....

🖥Demo site: I am very vulnerable...please do not stress test (·•᷄ࡇ•᷅ )

🍔Web APP:https://douyin.wtf/

🍟API Document:https://douyin.wtf/docs

🌭TikHub API Document:https://api.tikhub.io/docs

💾iOS Shortcut (shortcut command):Shortcut release

📦Desktop downloader (recommended by warehouse):

⚗️Technology stack

/crawlers

  • Submit requests to APIs on different platforms and retrieve data. After processing, a dictionary (dict) is returned, and asynchronous support is supported.

/app/api

  • Get request parameters and useCrawlersThe related classes process the data and return it in JSON form, download the video, and cooperate with iOS shortcut commands to achieve fast calling and support asynchronous.

/app/web

  • usePyWebIOA simple web program created to process the values entered on the web page and then use themCrawlersThe related class processing interface outputs related data on the web page.

Most of the parameters of the above files can be found in the correspondingconfig.yamlMake changes in

💡Project file structure

./Douyin_TikTok_Download_API
    ├─app
    │  ├─api
    │  │  ├─endpoints
    │  │  └─models
    │  ├─download
    │  └─web
    │      └─views
    └─crawlers
        ├─douyin
        │  └─web
        ├─hybrid
        ├─tiktok
        │  ├─app
        │  └─web
        └─utils

Features:

  • Douyin Web Most API
  • TikTok WebMost APIs
  • Batch analysis on the web page (supports Douyin/TikTok mixed submission)
  • Download videos or photo albums online.
  • API call to get link data
  • makepip packageConveniently and quickly import your projects
  • iOS shortcut commands to quickly call APIAchieve in-app download of watermark-free videos/photo albums
  • Analyze all videos on the author's homepage (Tikhub-opySupport Douyin/TikTok)
  • Parse all comment information in the video (Tikhub-opySupport Douyin/TikTok)

📦Call the parsing library (to be updated):

💡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/Bilibili share URL here: ")))

🗺️Supported submission formats:

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

  • Kuaishou video link
https://www.kuaishou.com/short-video/3xiqjrezhqjyzxw/
https://v.kuaishou.com/75kDOJ/
  • Watermelon video link
https://www.ixigua.com/7270448082586698281/
https://m.ixigua.com/video/7274710134306112054/
  • Bilibili video link
https://www.bilibili.com/video/BV1Th411x7ii/
  • Douyin sharing password (copy in APP)
7.43 pda:/ 让你在几秒钟之内记住我  https://v.douyin.com/L5pbfdP/ 复制此链接打开Dou音搜索直接观看视频
  • Douyin short URL (copy within APP)
https://v.douyin.com/L4FJNR3/
  • Douyin normal URL (copy from web version)
https://www.douyin.com/video/6914948781100338440
  • Douyin discovery page URL (APP copy)
https://www.douyin.com/discover?modal_id=7069543727328398622
  • TikTok short URL (copy within APP)
https://www.tiktok.com/t/ZTR9nDNWq/
  • TikTok normal URL (copy from web version)
https://www.tiktok.com/@evil0ctal/video/7156033831819037994
  • Douyin/TikTok batch URL (no need to use matching separation)
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

API documentation:

local:http://localhost:8000/docs

Online:https://api.douyin.wtf/docs

API demo:

  • Crawl video data (TikTok or Douyin hybrid analysis)https://api.douyin.wtf/api/hybrid/video_data?url=[视频链接/Video URL]&minimal=false
  • Download videos/photo albums (TikTok or Douyin hybrid analysis)https://api.douyin.wtf/api/download?url=[视频链接/Video URL]&prefix=true&with_watermark=false

For more demonstrations, please see the documentation...

💻Deployment (Method 1 Linux)

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

Recommended for everyone to useDigitaloceanservers, mainly because they are free.

Use my invitation link to sign up and you can get a $200 credit, and when you spend $25 on it, I can also get a $25 reward.

My invitation link:

https://m.do.co/c/9f72a27dec35

Use script to deploy this project with one click

Start/stop service

  • systemctl start/stop Douyin_TikTok_Download_API.service

Turn on/off automatic operation at startup

  • systemctl enable/disable Douyin_TikTok_Download_API.service

Update project

  • cd /www/wwwroot/Douyin_TikTok_Download_API/bash && sudo bash update.sh

💽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.ini 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

❤️Contributor

📸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%