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-09-05 21:25:01 -07:00
2022-04-06 12:10:40 -07: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-10 01:56:00 -08:00
2022-11-09 17:49:59 -08:00
2022-11-10 01:20:26 -08:00
2022-10-17 21:08:10 -07:00
2022-11-09 16:59:05 -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 onPyWebIOFastAPIHTTPX, fast asynchronousTik Tok/TikTokData crawling tool, and realize online batch parsing and download of video or atlas without watermark, data crawling API, iOS shortcut command without watermark download and other functions through the Web terminal. 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 inputDouyin|TikTokThe 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, pleasetimeoutSet 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 useScraper()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:

  • forweb_api.pyas well asscraper.pyCreated a simple web program that processes the value entered on the web page and uses itScraper()Class handling and coordinationweb_api.pyThe 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 parsing result page on the webpage (V3.0.0 temporarily removed)
  • API call to get link data
  • makepip packageEasily and quickly import your projects
  • [iOS shortcut command to quickly call API]Realize 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♪(・ω・)ノ)

🧭 Running Instructions (Python version > 3.0):

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

  • Clone this repository:
git clone https://github.com/Evil0ctal/Douyin_TikTok_Download_API.git
  • Move to repository directory:
cd Douyin_TikTok_Download_API
  • Install dependent libraries:
pip install -r requirements.txt
  • Modify config.ini (optional):
vim config.ini
  • Web page parsing
# 运行web_app.py
python3 web_app.py
  • API
# 运行web_api.py
python3 web_api.py
  • call parsing library
# pip install DT-Scraper
from DT_scraper.scraper import Scraper
	
api = Scraper()
	
async def async_test(url: str):
	if 'douyin' in url:
		douyin_url = await api.convert_share_urls(url)
		# Get Douyin ID and video data
		douyin_id = await api.get_douyin_video_id(douyin_url)
		douyin_data = await api.get_douyin_video_data(douyin_id)
	elif 'tiktok' in url:
		tiktok_url = await api.convert_share_urls(url)
		# Get TikTok video data
		tiktok_id = await api.get_tiktok_video_id(tiktok_url)
		tiktok_data = await api.get_tiktok_video_data(tiktok_id)
		
	# Hybrid parsing(Any platform URL)
	hybrid_data = await api.hybrid_parsing(url)
	
asyncio.run(async_test(url=input("Paste Douyin/TikTok share URL here: "))
  • Entry (port can be modified in the 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 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 URL Shortening (In-App Copy)
例子:
https://vm.tiktok.com/TTPdkQvKjP/
  • TikTok normal URL (copy from web version)
例子:
https://www.tiktok.com/@tvamii/video/7045537727743380782
  • Douyin/TikTok bulk URLs (no need to separate them)
例子:
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


💾Deployment (method 1 manual deployment)

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

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

example: The project is deployed on a domestic server, and the person is in the United States. Clicking the link on the result page reports an error 403, which is visually related to the Douyin CDN. The project is deployed on a South Korean server, parsing TikTok errors, and visually TikTok restricts certain regions or IPs.

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

  • First go to the security group to open ports 8080 and 8000 (default 8080 for Web, default 8000 for API, 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 where you upload the file
  • Python version needs to be at least 3 or more (install it yourself in the version management on the left)
  • The frame is modified toUvicorn
  • The startup method is changed topython
  • Web startup file selectionweb_app.py
  • API startup file selectionweb_api.py
  • Check install module dependencies
  • Start at will
  • Please judge by yourself whether the port is occupied. The running port can be modified in the file config.ini.
  • If there are a lot of requests please use_process daemon_Start preventing process from closing


💾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 problems, 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%