This commit is contained in:
jw 2022-08-22 15:58:40 +08:00
commit 92439d7ed9
2 changed files with 295 additions and 215 deletions

View File

@ -4,11 +4,12 @@
Language: \[[English](https://github.com/Evil0ctal/Douyin_TikTok_Download_API/blob/main/README.en.md)] \[[Simplified Chinese](https://github.com/Evil0ctal/Douyin_TikTok_Download_API/blob/main/README.md)] \[[traditional Chinese](https://github.com/Evil0ctal/Douyin_TikTok_Download_API/blob/main/README.zh-TW.md)] Language: \[[English](https://github.com/Evil0ctal/Douyin_TikTok_Download_API/blob/main/README.en.md)] \[[Simplified Chinese](https://github.com/Evil0ctal/Douyin_TikTok_Download_API/blob/main/README.md)] \[[traditional Chinese](https://github.com/Evil0ctal/Douyin_TikTok_Download_API/blob/main/README.zh-TW.md)]
> Note: This API is applicable to Douyin and TikTok. Douyin is TikTok in China. You can distribute or modify the code at will, but please mark the original author. > Note: This API is applicable to Douyin and TikTok. Douyin is TikTok in China. You can distribute or modify the code at
> will, but please mark the original author.
> Note: This API is suitable for Douyin and TikTok. Douyin is TikTok in China. You can distribute or modify the code at will, but please mark the original author. > Note: This API is suitable for Douyin and TikTok. Douyin is TikTok in China. You can distribute or modify the code at will, but please mark the original author.
Ladies and gentlemen, this site has been providing free API services since November 2021. The server cost of Azure is basically 15$ per month, so please sponsor me a little bit if you can (not just want to eat, the United States is too toothless) Expensive and no money••), so if you have the ability, you can sponsor my overseas server or transfer money to me, I will put the sponsorship list in the project readme file, and sincerely thank you for your recognition and support, really It's not because I want to have a meal, it's forced by life, and it's a helpless move. I hope you understand. Ladies and gentlemen, this site has been providing free API services since November 2021. The server cost of Azure is basically 15$ per month, so please sponsor me a little bit if you can (not just want to eat, the United States is too toothless) Expensive and no money••), so if you have the ability, you can sponsor my overseas server or transfer money to me, I will put the sponsorship list in the project readme file, and sincerely thank you for your recognition and support, really It's not just a meal, it's forced by life, it's a helpless move, I hope you understand.
The server problem has been solved (the wool is 4$ per month). The disadvantage is that it is a bit slow. The average response speed of the API is about 1s. If you think it is too slow, you can try to deploy it yourself. The server problem has been solved (the wool is 4$ per month). The disadvantage is that it is a bit slow. The average response speed of the API is about 1s. If you think it is too slow, you can try to deploy it yourself.
@ -16,15 +17,18 @@ My WeChat: Evil0ctal
## 👻Introduction ## 👻Introduction
> For the sake of stability, the two functions of /video (returns mp4 files) and /music (returns mp3 files) of the demo station are temporarily closed, and the batch download function of the result page is also temporarily unavailable. If you need it, please deploy it yourself , other functions can still be used normally on the demo site. The API server guarantees normal operation 99% of the time, but does not guarantee 100% successful parsing. If parsing fails, please wait a minute or two and try again. > For stability reasons, temporarily close /video (returns mp4 files) and /music (returns mp3 files) of the demo station
> These two functions, and the batch download function of the result page are also temporarily unavailable. If you need it, please deploy it yourself. Other functions can still be used normally on the demo site. The API server guarantees 99% of the time to run normally, but does not guarantee 100% parsing. Success, if parsing fails please wait a minute or two and try again.
🚀Demo address:<https://douyin.wtf/> 🚀Demo address:<https://douyin.wtf/>
🛰API demo:<https://api.douyin.wtf/> 🛰API demo:<https://api.douyin.wtf/>
💾iOS Shortcuts (Chinese):[Click to get](https://www.icloud.com/shortcuts/331073aca78345cf9ab4f73b6a457f97)(Updated on 2022/07/18, the shortcut command can automatically check for updates, just install it once.) 💾iOS Shortcuts (Chinese):[Click to get](https://www.icloud.com/shortcuts/331073aca78345cf9ab4f73b6a457f97)(
Updated on 2022/07/18, the shortcut command can automatically check for updates, and you can install it once. )
🌎iOS Shortcut(English):[Click to get](https://www.icloud.com/shortcuts/83548306bc0c4f8ea563108f79c73f8d)(Updated on 2022/07/18, this shortcut will automatically check for updates, only need to install it once.) 🌎iOS Shortcut(English):[Click to get](https://www.icloud.com/shortcuts/83548306bc0c4f8ea563108f79c73f8d)(Updated on
2022/07/18, this shortcut will automatically check for updates, only need to install it once.)
🗂 Shortcut History Version:[Shortcuts release](https://github.com/Evil0ctal/Douyin_TikTok_Download_API/issues/53) 🗂 Shortcut History Version:[Shortcuts release](https://github.com/Evil0ctal/Douyin_TikTok_Download_API/issues/53)
@ -32,9 +36,10 @@ My WeChat: Evil0ctal
This project uses[PyWebIO](https://github.com/pywebio/PyWebIO)、[Flask](https://github.com/pallets/flask), using Python to implement online batch parsing of Douyin's watermark-free video/atlas. This project uses[PyWebIO](https://github.com/pywebio/PyWebIO)、[Flask](https://github.com/pallets/flask), using Python to implement online batch parsing of Douyin's watermark-free video/atlas.
It can be used to download videos that the author prohibits to download, or to perform data crawling, etc., and can be matched with[Shortcut APP that comes with iOS](https://apps.apple.com/cn/app/%E5%BF%AB%E6%8D%B7%E6%8C%87%E4%BB%A4/id915249334)Cooperate with the API of this project to realize in-app download. It can be used to download videos that the author prohibits to download, or to perform data crawling, etc., and can be matched with[Shortcut APP that comes with iOS](https://apps.apple.com/cn/app/%E5%BF%AB%E6%8D%B7%E6%8C%87%E4%BB%A4/id915249334)Cooperate with this project API to realize in-app download.
The shortcut command needs to be in the Douyin or TikTok app, select the video you want to save, click the share button, and then find the option "Douyin TikTok without watermark download", if you encounter a notification asking whether to allow the shortcut command to access xxxx (domain name) or server), you need to click Allow to use it normally, and the successfully downloaded video or gallery will be saved in a special album for easy browsing. The shortcut command needs to be in the Douyin or TikTok app, select the video you want to save, click the share button, and then find "Douyin TikTok No Watermark Download"
This option, if you encounter a notification asking whether to allow shortcut commands to access xxxx (domain name or server), you need to click Allow before it can be used normally. The successfully downloaded video or gallery will be saved in a special album for easy browsing.
## 💡Project file structure ## 💡Project file structure
@ -113,6 +118,7 @@ python3 web_api.py
# 将scraper.py拷贝至你的项目目录 # 将scraper.py拷贝至你的项目目录
# 在该项目中导入scraper.py # 在该项目中导入scraper.py
from scraper import Scraper from scraper import Scraper
api = Scraper() api = Scraper()
# 解析Douyin视频/图集 # 解析Douyin视频/图集
douyin_data = api.douyin(input('在此输入抖音分享口令/链接:')) douyin_data = api.douyin(input('在此输入抖音分享口令/链接:'))
@ -175,7 +181,7 @@ https://vm.tiktok.com/TTPdkQvKjP/
https://www.tiktok.com/@tvamii/video/7045537727743380782 https://www.tiktok.com/@tvamii/video/7045537727743380782
``` ```
- Douyin/TikTok bulk URLs (no need to separate them) - 抖音/TikTok批量网址(无需使用符合隔开)
```text ```text
例子: 例子:
@ -331,10 +337,10 @@ http://localhost(服务器IP):2333/music?url="复制的(抖音/TikTok)口令/链
* * * * * *
## 💾Deploy ## 💾Deployment (Method 1)
> Note: > Note:
> The screenshots may not match the text due to update problems. Please refer to the text description first. > 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. > It is best to deploy this project to an overseas server (preferably a server in the United States), otherwise strange problems may occur.
@ -342,10 +348,11 @@ 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 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. The project is deployed on a South Korean server, parsing TikTok errors, and visually TikTok restricts certain regions or IPs.
> Use the pagoda Linux panel for deployment (Chinese pagoda must be bound to the mobile phone number, which is very rogue and cannot be bypassed. It is recommended to use the pagoda international version, Google search keyword aapanel to install it yourself, and the deployment steps are similar.) > 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 5000 and 2333 (default 5000 for Web, 2333 for API, which can be modified in the file config.ini.) - First go to the security group to open ports 5000 and 2333 (default 5000 for Web, 2333 for API default, 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) - Search for python in the Pagoda app store and install the project manager (version 1.9 is recommended)
![](https://raw.githubusercontent.com/Evil0ctal/TikTokDownloader_PyWebIO/main/Screenshots/BT_Linux_Panel_Deploy_1.png) ![](https://raw.githubusercontent.com/Evil0ctal/TikTokDownloader_PyWebIO/main/Screenshots/BT_Linux_Panel_Deploy_1.png)
@ -366,10 +373,43 @@ The project is deployed on a South Korean server, parsing TikTok errors, and vis
* * * * * *
## 💾Deployment (method 2 docker)
- install docker
```yaml
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 keep the container running in the background
```yaml
docker compose up -d
```
- View container logs
```yaml
docker logs -f douyin_tiktok_download_api
```
- delete container
```yaml
docker rm -f douyin_tiktok_download_api
```
- renew
```yaml
docker compose pull && docker compose down && docker compose up -d
```
## 🎉 Screenshot ## 🎉 Screenshot
> Note: > Note:
> The screenshots may not match the text due to update problems. Please refer to the text description first. > The screenshots may not match the text due to update problems, please refer to the text description first.
- Main interface - Main interface

View File

@ -4,7 +4,8 @@
語: \[[英語](https://github.com/Evil0ctal/Douyin_TikTok_Download_API/blob/main/README.en.md)] \[[簡體中文](https://github.com/Evil0ctal/Douyin_TikTok_Download_API/blob/main/README.md)] \[[繁體中文](https://github.com/Evil0ctal/Douyin_TikTok_Download_API/blob/main/README.zh-TW.md)] 語: \[[英語](https://github.com/Evil0ctal/Douyin_TikTok_Download_API/blob/main/README.en.md)] \[[簡體中文](https://github.com/Evil0ctal/Douyin_TikTok_Download_API/blob/main/README.md)] \[[繁體中文](https://github.com/Evil0ctal/Douyin_TikTok_Download_API/blob/main/README.zh-TW.md)]
> 注此API適用於抖音和抖音。抖音是中國的TikTok。您可以隨意分發或修改代碼但請註明原作者。 > 注此API適用於抖音和抖音。抖音是中國的TikTok。您可以在以下位置分發或修改代碼
> 會,但請註明原作者。
> 注: 此API適用於Douyin和TikTokDouyin為中國區域的TikTok你可以隨意分發或修改代碼但請標註原作者。 > 注: 此API適用於Douyin和TikTokDouyin為中國區域的TikTok你可以隨意分發或修改代碼但請標註原作者。
@ -16,15 +17,18 @@
## 👻介紹 ## 👻介紹
> 出於穩定性的考慮,暫時關閉演示站的/video(返回mp4文件)和/music(返回mp3文件)這兩個功能同時結果頁面的批量下載功能也暫時不可用如有需求請自行部署其他功能在演示站上仍正常使用API服務器保證99%的時間正常運行但不保證解析100%成功,如果解析失敗請等一兩分鐘後重試。 > 出於穩定性的考慮,暫時關閉演示站的/video(返回mp4文件)和/music(返回mp3文件)
> 這兩個功能同時結果頁面的批量下載功能也暫時不可用如有需求請自行部署其他功能在演示站上仍正常使用API服務器保證99%的時間正常運行但不保證解析100%成功,如果解析失敗請等一兩分鐘後重試。
🚀演示地址:<https://douyin.wtf/> 🚀演示地址:<https://douyin.wtf/>
🛰API演示<https://api.douyin.wtf/> 🛰API演示<https://api.douyin.wtf/>
💾iOS快捷指令(中文):[點擊獲取](https://www.icloud.com/shortcuts/331073aca78345cf9ab4f73b6a457f97)(更新於2022/07/18快捷指令可自動檢查更新安裝一次即可。) 💾iOS快捷指令(中文):[點擊獲取](https://www.icloud.com/shortcuts/331073aca78345cf9ab4f73b6a457f97)(
更新於2022/07/18快捷指令可自動檢查更新安裝一次即可。 )
🌎iOS快捷方式英文[點擊獲取](https://www.icloud.com/shortcuts/83548306bc0c4f8ea563108f79c73f8d)2022/07/18更新這個快捷方式會自動檢查更新只需要安裝一次。 🌎iOS快捷方式英文[點擊獲取](https://www.icloud.com/shortcuts/83548306bc0c4f8ea563108f79c73f8d)(更新於
2022/07/18這個快捷方式會自動檢查更新只需要安裝一次。
🗂快捷指令歷史版本:[快捷方式發布](https://github.com/Evil0ctal/Douyin_TikTok_Download_API/issues/53) 🗂快捷指令歷史版本:[快捷方式發布](https://github.com/Evil0ctal/Douyin_TikTok_Download_API/issues/53)
@ -34,7 +38,8 @@
可用於下載作者禁止下載的視頻,或者進行數據爬取等等,同時可搭配[iOS自帶的快捷指令APP](https://apps.apple.com/cn/app/%E5%BF%AB%E6%8D%B7%E6%8C%87%E4%BB%A4/id915249334)配合本項目API實現應用內下載。 可用於下載作者禁止下載的視頻,或者進行數據爬取等等,同時可搭配[iOS自帶的快捷指令APP](https://apps.apple.com/cn/app/%E5%BF%AB%E6%8D%B7%E6%8C%87%E4%BB%A4/id915249334)配合本項目API實現應用內下載。
快捷指令需要在抖音或TikTok的APP內選擇你想要保存的視頻點擊分享按鈕然後找到 "抖音TikTok無水印下載" 這個選項如遇到通知詢問是否允許快捷指令訪問xxxx (域名或服務器),需要點擊允許才可以正常使用,下載成功的視頻或圖集會保存在一個專門的相冊中以方便瀏覽。 快捷指令需要在抖音或TikTok的APP內選擇你想要保存的視頻點擊分享按鈕然後找到 "抖音TikTok無水印下載"
這個選項如遇到通知詢問是否允許快捷指令訪問xxxx (域名或服務器),需要點擊允許才可以正常使用,下載成功的視頻或圖集會保存在一個專門的相冊中以方便瀏覽。
## 💡項目文件結構 ## 💡項目文件結構
@ -113,6 +118,7 @@ python3 web_api.py
# 将scraper.py拷贝至你的项目目录 # 将scraper.py拷贝至你的项目目录
# 在该项目中导入scraper.py # 在该项目中导入scraper.py
from scraper import Scraper from scraper import Scraper
api = Scraper() api = Scraper()
# 解析Douyin视频/图集 # 解析Douyin视频/图集
douyin_data = api.douyin(input('在此输入抖音分享口令/链接:')) douyin_data = api.douyin(input('在此输入抖音分享口令/链接:'))
@ -331,7 +337,7 @@ http://localhost(服务器IP):2333/music?url="复制的(抖音/TikTok)口令/链
* * * * * *
## 💾部署 ## 💾部署(方式一)
> 注: > 注:
> 截圖可能因更新問題與文字不符,一切請優先參照文字敘述。 > 截圖可能因更新問題與文字不符,一切請優先參照文字敘述。
@ -342,7 +348,8 @@ http://localhost(服务器IP):2333/music?url="复制的(抖音/TikTok)口令/链
項目部署在國內服務器而人在美國點擊結果頁面鏈接報錯403 目測與抖音CDN有關係。 項目部署在國內服務器而人在美國點擊結果頁面鏈接報錯403 目測與抖音CDN有關係。
項目部署在韓國服務器解析TikTok報錯 目測TikTok對某些地區或IP進行了限制。 項目部署在韓國服務器解析TikTok報錯 目測TikTok對某些地區或IP進行了限制。
> 使用寶塔Linux面板進行部署(中文寶塔要強制綁定手機號了很流氓且無法繞過建議使用寶塔國際版谷歌搜索關鍵字aapanel自行安裝部署步驟相似。) > 使用寶塔Linux面板進行部署(
> 中文寶塔要強制綁定手機號了很流氓且無法繞過建議使用寶塔國際版谷歌搜索關鍵字aapanel自行安裝部署步驟相似。 )
- 首先要去安全組開放5000和2333端口Web默認5000API默認2333可以在文件config.ini中修改。 - 首先要去安全組開放5000和2333端口Web默認5000API默認2333可以在文件config.ini中修改。
- 在寶塔應用商店內搜索python並安裝項目管理器 (推薦使用1.9版本) - 在寶塔應用商店內搜索python並安裝項目管理器 (推薦使用1.9版本)
@ -366,6 +373,39 @@ http://localhost(服务器IP):2333/music?url="复制的(抖音/TikTok)口令/链
* * * * * *
## 💾部署(方式二 docker)
- 安裝docker
```yaml
curl -fsSL get.docker.com -o get-docker.sh&&sh get-docker.sh &&systemctl enable docker&&systemctl start docker
```
- 留下config.int和docker-compose.yml文件即可
- 運行命令,讓容器在後台運行
```yaml
docker compose up -d
```
- 查看容器日誌
```yaml
docker logs -f douyin_tiktok_download_api
```
- 刪除容器
```yaml
docker rm -f douyin_tiktok_download_api
```
- 更新
```yaml
docker compose pull && docker compose down && docker compose up -d
```
## 🎉截圖 ## 🎉截圖
> 注: > 注: