2022-11-14 17:40:40 -08:00
2022-11-08 06:26:04 -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-14 02:20:28 -08:00
2022-11-13 16:39:04 -08:00
2022-11-13 23:13:13 -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)

📝运行说明👽API使用🔧手动部署🚧Docker部署📦Docker镜像🧑‍💻贡献者


GitHub licenseGitHub issuesGitHub forksGitHub starsDocker Image size

Language: [English] [Simplified Chinese]

👻 Introduction

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...please don't hit me (••᷄ࡇ•᷅

**API-V2:**support inputDouyin|TikTokCrawl the author's homepage [homepage video data (remove the watermark link, the list of liked videos (permissions 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()After the class processes the data, it returns in the form of JSON, video downloads, quick calls with iOS shortcut commands, 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 web page (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)

💯 Supported functions:

  • Douyin (overseas version of Douyin: TikTok) video/picture analysis
  • Batch analysis on the web page (supports Douyin/TikTok mixed submission)
  • Batch download of non-watermarked videos from the analysis result page on the web page (temporarily removed in V3.0.0)
  • API call to get link data
  • makepip packageEasily and quickly import your projects
  • [iOS shortcut command to quickly call API]Realize 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)

🤦Following features:

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

🧭Running instructions (Python version > 3.0):

🚨If you want to deploy this project, please refer to the deployment method (Docker deployment,manual deployment)

  • Clone the repository:
git clone https://github.com/Evil0ctal/Douyin_TikTok_Download_API.git
  • Move to the repository directory:
cd Douyin_TikTok_Download_API
  • Install dependent libraries:
pip install -r requirements.txt
  • Modify config.ini (optional):
vim config.ini
  • web page analysis
# 运行web_app.py
python3 web_app.py
  • API
# 运行web_api.py
python3 web_api.py
  • call parsing library
import asyncio
# pip install douyin-tiktok-scraper
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 data is: {hybrid_data}")
    return hybrid_data

asyncio.run(async_test(url=input("Paste Douyin/TikTok share URL here: ")))
  • Entry (port can be modified in config.ini file)
Web入口:
http://localhost(服务器IP):8080/
API入口:
http://localhost(服务器IP):8000/

🗺️Supported submission formats (including but not limited to the following examples):

  • 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://vm.tiktok.com/TTPdkQvKjP/
  • TikTok normal URL (web version copy)
例子:
https://www.tiktok.com/@tvamii/video/7045537727743380782
  • Douyin/TikTok bulk URLs (no need to use symbols to separate)
例子:
2.84 nqe:/ 骑白马的也可以是公主%%百万转场变身  https://v.douyin.com/L4FJNR3/ 复制此链接打开Dou音搜索直接观看视频
8.94 mDu:/ 让你在几秒钟之内记住我  https://v.douyin.com/L4NpDJ6/ 复制此链接打开Dou音搜索直接观看视频
9.94 LWz:/ ok我坦白交代 %%knowknow  https://v.douyin.com/L4NEvNn/ 复制此链接打开Dou音搜索直接观看视频
https://www.tiktok.com/@gamer/video/7054061777033628934
https://www.tiktok.com/@off.anime_rei/video/7059609659690339586
https://www.tiktok.com/@tvamii/video/7045537727743380782

🛰️API Documentation

You can also see the interface documentation in the code of web_api.py

API-V1 documentation:http://localhost(server IP):8000/docsorhttps://api.douyin.wtf/docs

API-V2 documentation:https://api-v2.douyin.wtf/docs

API demo:

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


💾Deployment (method 1 manual deployment)

Note: The screenshots may not match the text due to update issues, please refer to the text description first.

It is best to deploy this project to an overseas server (a server in the United States is preferred), otherwise strange problems may occur.

example: The project is deployed on a domestic server, but the person is in the United States. Clicking on the link on the result page reports an error 403, which is related to the Douyin CDN by visual inspection. The project is deployed on the South Korean server, and TikTok reports an error, visually checking that TikTok has restricted certain regions or IPs.

Deploy using Pagoda Linux panel ( The Chinese Pagoda has to be bound to a mobile phone number. It is very rogue and cannot be bypassed. It is recommended to use the international version of Pagoda. Google the keyword aapanel to install it yourself. The deployment steps are similar. )

  • First of all, go to the security group to open ports 8080 and 8000 (Web defaults to 8080, API defaults to 8000, which can be modified in the file config.ini.)
  • Search for python in the Pagoda app store and install the project manager (version 1.9 is recommended)


  • Create a project with an arbitrary name
  • Path select the path of your uploaded file
  • The Python version needs to be at least 3 or more (install it yourself in the version management on the left)
  • The framework is modified toUvicorn
  • The startup method is changed topython
  • Web startup file selectionweb_app.py
  • API startup file selectionweb_api.py
  • Check the install module dependencies
  • Start up at will
  • Please judge whether the port is occupied by yourself. The running port can be modified in the file config.ini.
  • If there are a lot of requests use_process daemon_start prevents process from shutting down


💾 Deployment (Method 2 Docker)

  • 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

Note: The screenshots may not match the text due to update issues, please refer to the text description first.

点击展开截图
  • Main interface


  • Parsing complete

single


batch


  • API submit/return

video return value

Atlas return value

TikTok return value


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