添加根路径显示信息

This commit is contained in:
Evil0ctal 2022-04-06 09:42:24 -07:00 committed by GitHub
parent 86c7987d5d
commit bbc503bfd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,7 +2,7 @@
# -*- encoding: utf-8 -*-
# @Author: https://github.com/Evil0ctal/
# @Time: 2021/11/06
# @Update: 2022/04/05
# @Update: 2022/04/06
# @Function:
# 创建一个接受提交参数的Flask应用程序。
# 将scraper.py返回的内容以JSON格式返回。
@ -39,6 +39,19 @@ def clean_filename(string, author_name):
return filename
@app.route("/", methods=["POST", "GET"])
def index():
# 显示基础信息
index_info = {'API status': 'Running',
'GitHub': 'https://github.com/Evil0ctal/Douyin_TikTok_Download_API',
'Introduction': 'Free and open source Douyin/TikTok watermark-free video download tool, supports API calls.',
'Web interface': 'https://douyin.wtf/',
'Parsing Douyin/TikTok videos': 'https://api.douyin.wtf/api?url=[Douyin/TikTok url]',
'Return Video MP4 File Download': 'https://api.douyin.wtf/video?url=[Douyin/TikTok url]',
'Return Video MP3 File Download': 'https://api.douyin.wtf/music?url=[Douyin/TikTok url]'}
return jsonify(index_info)
@app.route("/api", methods=["POST", "GET"])
def webapi():
# 创建一个Flask应用获取POST参数并返回结果
@ -75,7 +88,6 @@ def webapi():
return jsonify(status='failed', reason='url value cannot be empty')
@app.route("/video", methods=["POST", "GET"])
def download_video():
# 用于返回视频下载请求(返回MP4文件下载请求面对大量请求时非常吃服务器内存容易崩慎用。)
@ -192,4 +204,4 @@ if __name__ == '__main__':
else:
# 默认端口
port = 2333
app.run(host='0.0.0.0', port=port)
app.run(host='0.0.0.0', port=port)