🐣修改了界面
This commit is contained in:
parent
ea4aa09c39
commit
692d0d7ba2
1 changed files with 18 additions and 11 deletions
|
|
@ -8,7 +8,7 @@
|
||||||
# 可用于下载作者禁止下载的视频,同时可搭配iOS的快捷指令APP配合本项目API实现应用内下载。
|
# 可用于下载作者禁止下载的视频,同时可搭配iOS的快捷指令APP配合本项目API实现应用内下载。
|
||||||
|
|
||||||
|
|
||||||
from pywebio import config
|
from pywebio import config, session
|
||||||
from pywebio.input import *
|
from pywebio.input import *
|
||||||
from pywebio.output import *
|
from pywebio.output import *
|
||||||
from pywebio.platform.flask import webio_view
|
from pywebio.platform.flask import webio_view
|
||||||
|
|
@ -125,15 +125,15 @@ def webapi():
|
||||||
try:
|
try:
|
||||||
post_content = request.args.get("url")
|
post_content = request.args.get("url")
|
||||||
if post_content:
|
if post_content:
|
||||||
response_data, type = get_video_info(post_content)
|
response_data, result_type = get_video_info(post_content)
|
||||||
if type == 'image':
|
if result_type == 'image':
|
||||||
# 返回图集信息json
|
# 返回图集信息json
|
||||||
return jsonify(Type=type, image_url=response_data[0], image_music=response_data[1],
|
return jsonify(Type=result_type, image_url=response_data[0], image_music=response_data[1],
|
||||||
image_title=response_data[2], image_author=response_data[3],
|
image_title=response_data[2], image_author=response_data[3],
|
||||||
image_author_id=response_data[4], original_url=response_data[5])
|
image_author_id=response_data[4], original_url=response_data[5])
|
||||||
else:
|
else:
|
||||||
# 返回视频信息json
|
# 返回视频信息json
|
||||||
return jsonify(Type=type, video_url=response_data[0], video_music=response_data[1],
|
return jsonify(Type=result_type, video_url=response_data[0], video_music=response_data[1],
|
||||||
video_title=response_data[2], video_author=response_data[3],
|
video_title=response_data[2], video_author=response_data[3],
|
||||||
video_author_id=response_data[4], original_url=response_data[5])
|
video_author_id=response_data[4], original_url=response_data[5])
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
@ -144,11 +144,11 @@ def webapi():
|
||||||
|
|
||||||
def put_result(item):
|
def put_result(item):
|
||||||
# 根据解析格式向前端输出表格
|
# 根据解析格式向前端输出表格
|
||||||
video_info, type = get_video_info(item)
|
video_info, result_type = get_video_info(item)
|
||||||
if type == 'video':
|
if result_type == 'video':
|
||||||
put_table([
|
put_table([
|
||||||
['类型', '内容'],
|
['类型', '内容'],
|
||||||
['格式:', type],
|
['格式:', result_type],
|
||||||
['视频直链: ', put_link('点击打开视频', video_info[0], new_window=True)],
|
['视频直链: ', put_link('点击打开视频', video_info[0], new_window=True)],
|
||||||
['背景音乐直链: ', put_link('点击打开音频', video_info[1], new_window=True)],
|
['背景音乐直链: ', put_link('点击打开音频', video_info[1], new_window=True)],
|
||||||
['视频标题: ', video_info[2]],
|
['视频标题: ', video_info[2]],
|
||||||
|
|
@ -159,7 +159,7 @@ def put_result(item):
|
||||||
else:
|
else:
|
||||||
put_table([
|
put_table([
|
||||||
['类型', '内容'],
|
['类型', '内容'],
|
||||||
['格式:', type],
|
['格式:', result_type],
|
||||||
])
|
])
|
||||||
for i in video_info[0]:
|
for i in video_info[0]:
|
||||||
put_table([
|
put_table([
|
||||||
|
|
@ -193,8 +193,14 @@ def popup_window():
|
||||||
|
|
||||||
@config(title=title, description=description)
|
@config(title=title, description=description)
|
||||||
def main():
|
def main():
|
||||||
# scope_0 = set_scope('scope_0', position=0)
|
# 设置favicon
|
||||||
placeholder = "如需批量解析请直接粘贴多个口令或链接无需使用符号分开。"
|
favicon_url = "https://raw.githubusercontent.com/Evil0ctal/TikTokDownload_PyWebIO/main/favicon/android-chrome-512x512.png"
|
||||||
|
session.run_js("""
|
||||||
|
$('#favicon32,#favicon16').remove();
|
||||||
|
$('head').append('<link rel="icon" type="image/png" href="%s">')
|
||||||
|
""" % favicon_url)
|
||||||
|
# 修改footer
|
||||||
|
session.run_js("""$('footer').remove()""")
|
||||||
put_markdown("""<div align='center' ><font size='20'>😼欢迎使用抖音在线解析</font></div>""")
|
put_markdown("""<div align='center' ><font size='20'>😼欢迎使用抖音在线解析</font></div>""")
|
||||||
put_html('<hr>')
|
put_html('<hr>')
|
||||||
put_row([put_link('GitHub', 'https://github.com/Evil0ctal', new_window=True),
|
put_row([put_link('GitHub', 'https://github.com/Evil0ctal', new_window=True),
|
||||||
|
|
@ -203,6 +209,7 @@ def main():
|
||||||
put_button("关于", onclick=lambda: popup_window(), link_style=True, small=True),
|
put_button("关于", onclick=lambda: popup_window(), link_style=True, small=True),
|
||||||
put_image('https://views.whatilearened.today/views/github/evil0ctal/TikTokDownload_PyWebIO.svg', title='访问记录')
|
put_image('https://views.whatilearened.today/views/github/evil0ctal/TikTokDownload_PyWebIO.svg', title='访问记录')
|
||||||
])
|
])
|
||||||
|
placeholder = "如需批量解析请直接粘贴多个口令或链接无需使用符号分开。"
|
||||||
kou_ling = textarea('请将抖音的分享口令或网址粘贴于此', type=TEXT, validate=valid_check, required=True, placeholder=placeholder, position=0)
|
kou_ling = textarea('请将抖音的分享口令或网址粘贴于此', type=TEXT, validate=valid_check, required=True, placeholder=placeholder, position=0)
|
||||||
if kou_ling:
|
if kou_ling:
|
||||||
url_lists = find_url(kou_ling)
|
url_lists = find_url(kou_ling)
|
||||||
Loading…
Reference in a new issue