From 41acd531a5854aebc41fd3796c56e7d7bd68f75f Mon Sep 17 00:00:00 2001 From: Evil0ctal Date: Mon, 17 Oct 2022 22:48:41 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9F=20Add=20keywords=20in=20header?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web_app.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/web_app.py b/web_app.py index 9db5667..ff1cc0c 100644 --- a/web_app.py +++ b/web_app.py @@ -2,7 +2,7 @@ # -*- encoding: utf-8 -*- # @Author: https://github.com/Evil0ctal/ # @Time: 2021/11/06 -# @Update: 2022/10/02 +# @Update: 2022/10/17 # @Function: # 用于在线批量解析Douyin/TikTok的无水印视频/图集。 # 基于 PyWebIO、Flask, 将scraper.py返回的内容显示在网页上。 @@ -31,6 +31,7 @@ app_config.read('config.ini', encoding='utf-8') web_config = app_config['Web_ZH'] title = web_config['Web_Title'] description = web_config['Web_Description'] +keywords = web_config['Keywords'] api_config = app_config['Web_API'] api_url = api_config['URL'] headers = { @@ -98,7 +99,9 @@ def error_do(reason, function, value): [function, str(reason), value]]) put_markdown(t('可能的原因:', 'Possible reasons:')) put_markdown(t('服务器可能被目标主机的防火墙限流(稍等片刻后再次尝试)', 'The server may be limited by the target host firewall (try again after a while)')) - put_markdown(t('输入了错误的链接(暂不支持主页链接解析)', 'Entered the wrong link (the home page link is not supported for parsing)')) + put_markdown(t('输入了错误的链接(API-V1暂不支持主页链接解析)', 'Entered the wrong link (the home page link is not supported for parsing with API-V1)')) + put_markdown(t('如果需要解析个人主页,请使用API-V2', 'If you need to parse the personal homepage, please use API-V2')) + put_markdown(t('API-V2 文档: [https://api-v2.douyin.wtf/docs](https://api-v2.douyin.wtf/docs)', 'API-V2 Documentation: [https://api-v2.douyin.wtf/docs](https://api-v2.douyin.wtf/docs)')) put_markdown(t('该视频已经被删除或屏蔽(你看的都是些啥(⊙_⊙)?)', 'The video has been deleted or blocked (what are you watching (⊙_⊙)?)')) put_markdown(t('其他原因(请联系作者)', 'Other reasons (please contact the author)')) put_html("
") @@ -366,7 +369,12 @@ def ios_pop_window(): def api_document_pop_window(): with popup(t("API文档", "API Document")): - put_markdown(t("💽API文档", "💽API Document")) + put_markdown(t("💾API-V2文档", "💾API-V2 Document")) + put_markdown(t('API-V2已经上线啦,支持更多功能,具体请查看接口文档。', + 'API-V2 has been launched and supports more functions. For details, please refer to the API documentation.')) + put_link('[API-V2 Docs]', 'https://api-v2.douyin.wtf/docs', new_window=True) + put_html('
') + put_markdown(t("💽API-V1文档", "💽API-V1 Document")) put_markdown(t("API可将请求参数转换为需要提取的无水印视频/图片直链,配合IOS捷径可实现应用内下载。", "API can convert the request parameters to the direct link of the watermark-free video/picture, which can be used with IOS shortcut to achieve download within the application.")) put_link('[中文文档]', 'https://github.com/Evil0ctal/Douyin_TikTok_Download_API#%EF%B8%8Fapi%E4%BD%BF%E7%94%A8', new_window=True) @@ -426,6 +434,10 @@ def main(): $('#favicon32,#favicon16').remove(); $('head').append('') """ % favicon_url) + # 设置Keywords + session.run_js(""" + $('head').append('') + """.format(keywords)) # 修改footer session.run_js("""$('footer').remove()""") # 访问记录