🚀「Douyin_TikTok_Download_API」是一个开箱即用的高性能异步抖音、快手、TikTok、Bilibili数据爬取工具,支持API调用,在线批量解析及下载。
感兴趣的给请加微信Evil0ctal
备注github项目重构,目前需要有爬虫/后端/全栈开发,如果你不具备相关技术栈也可以进来,主要是想着拉一个群然后大家可以在群里互相交流学习,不允许发广告以及违法的东西,纯粹交朋友和技术交流。
Discord: TikHub Discord
本项目是基于 PyWebIO,FastAPI,AIOHTTP,快速异步的抖音/TikTok/Bilibili数据爬取工具,并通过Web端实现在线批量解析以及下载无水印视频或图集,数据爬取API,iOS快捷指令无水印下载等功能。你可以自己部署或改造本项目实现更多功能,也可以在你的项目中直接调用scraper.py或安装现有的pip包作为解析库轻松爬取数据等.....
一些简单的运用场景:
下载禁止下载的视频,进行数据分析,iOS无水印下载(搭配iOS自带的快捷指令APP 配合本项目API实现应用内下载或读取剪贴板下载)等.....
TikHub-API: 支持
Douyin|TikTok
用户主页爬取该作者[主页视频数据(去水印链接, 已点赞视频列表(权限需为公开), 视频评论数据, 背景音乐视频列表数据, 等等...), 详细信息请查看TikHub-API文档,此外TikHub-API对比本项目API在抓取TikTok数据时,TikHub-API速度更快。
🍔Web APP: https://douyin.wtf/
🍟API Document: https://api.douyin.wtf/docs
🌭TikHub API Document: https://api.tikhub.io/docs
💾iOS Shortcut(快捷指令): Shortcut release
📦️桌面端下载器(仓库推荐):
🛸基于本项目的其他仓库
scraper.py:
web_api.py:
Scraper()
类处理数据后以JSON形式返回,视频下载,配合iOS快捷指令实现快速调用,支持异步。web_app.py:
web_api.py
以及scraper.py
制作的简易Web程序,将网页输入的值进行处理后使用Scraper()
类处理并配合web_api.py
的接口输出在网页上(类似前后端分离)以上文件的参数大多可在config.ini中进行修改
.
└── 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)
├── install.sh -> (Installation bash script)
💡欢迎提出建议或直接提交PR至此仓库 ♪(・ω・)ノ)
安装解析库: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: ")))
💡提示:包含但不仅限于以下例子,如果遇到链接解析失败请开启一个新 issue
https://www.kuaishou.com/short-video/3xiqjrezhqjyzxw/
https://v.kuaishou.com/75kDOJ/
https://www.ixigua.com/7270448082586698281/
https://m.ixigua.com/video/7274710134306112054/
https://www.bilibili.com/video/BV1Th411x7ii/
7.43 pda:/ 让你在几秒钟之内记住我 https://v.douyin.com/L5pbfdP/ 复制此链接,打开Dou音搜索,直接观看视频!
https://v.douyin.com/L4FJNR3/
https://www.douyin.com/video/6914948781100338440
https://www.douyin.com/discover?modal_id=7069543727328398622
https://www.tiktok.com/t/ZTR9nDNWq/
https://www.tiktok.com/@evil0ctal/video/7156033831819037994
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
💡提示:也可以在web_api.py的代码注释中查看接口文档
API文档:
在线:https://api.douyin.wtf/docs
TikHub-API文档:
API演示:
https://api.douyin.wtf/api?url=[视频链接/Video URL]&minimal=false
https://api.douyin.wtf/download?url=[视频链接/Video URL]&prefix=true&watermark=false
[抖音]
原始链接:
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
更多演示请查看文档内容......
💡提示:最好将本项目部署至美国地区的服务器,否则可能会出现奇怪的BUG。
推荐大家使用Digitalocean的服务器,主要是因为免费。
使用我的邀请链接注册,你可以获得$200的credit,当你在上面消费$25时,我也可以获得$25的奖励。
我的邀请链接:
https://m.do.co/c/9f72a27dec35
使用脚本一键部署本项目
wget -O install.sh https://raw.githubusercontent.com/Evil0ctal/Douyin_TikTok_Download_API/main/bash/install.sh && sudo bash install.sh
Please edit config.ini, all input must be numbers!
Default API port: 8000
If you want use different port input new API port here: 80
Use new port for web_api.py: 80
Default API rate limit: 10/minute
If you want use different rate limit input new rate limit here: 60
Use new rate limit: 60/minute
Default App port: 80
If you want use different port input new App port here: 8080
Use new port: 8080
api:单独启动web_api.py
web:单独启动web_app.py
all:同时启动web_api.py
和web_app.py
Run API or Web? [api/web/all/quit] api
Do you want to start the api service when system boot? [y/n] y
Created symlink /etc/systemd/system/multi-user.target.wants/web_api.service → /etc/systemd/system/web_api.service.
API service will start when system boot!
Starting API...
API is running! You can visit http://your_ip:port
You can stop the api service by running: systemctl stop web_api.service
开启/停止服务
systemctl start/stop web_app.service
systemctl start/stop web_api.service
开启/关闭开机自动运行
systemctl enable/disable web_app.service
systemctl enable/disable web_api.service
更新项目
cd /www/wwwroot/Douyin_TikTok_Download_API/bash
sudo sh update.sh
💡Docker Image repo: Docker Hub
curl -fsSL get.docker.com -o get-docker.sh&&sh get-docker.sh &&systemctl enable docker&&systemctl start docker
docker-compose up -d
docker logs -f douyin_tiktok_download_api
docker rm -f douyin_tiktok_download_api
docker-compose pull && docker-compose down && docker-compose up -d
API速度测试(对比官方API)
抖音官方API:
本项目API:
TikTok官方API:
本项目API:
项目界面
Web主界面:
Web main interface:
Start: 2021/11/06 GitHub: @Evil0ctal Contact: [email protected]