flask播放视频网站
python代码:
# -*- coding: utf-8 -*-
from flask import Flask,request,render_template
app = Flask(__name__)
@app.route("/",methods=['GET'])
def hello_world():
list = [
'1 a.mkv',
'[Kamigami] Psycho-Pass - 01 [1280x720 x264 AAC Sub(CH,JP)].mkv',
'[Kamigami] Psycho-Pass - 02 [1280x720 x264 AAC Sub(CH,JP)].mkv'
]
return render_template("index.html",list=list)
if __name__ == '__main__':
app.run(debug=True,host='0.0.0.0',port=8000)
html代码:
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>yz</title>
</head>
<body>
<video width="320" height="240" controls>
<source src="{{ url_for('static',filename='[Kamigami] Psycho-Pass - 01 [1280x720 x264 AAC Sub(CH,JP)].mkv') }}" type="video/mp4">
</video>
{% for i in list %}
<video width="320" height="240" controls>
<source src="{{ url_for('static',filename=i) }}" type="video/mp4">
</video>
{% endfor %}
</body>
<script>
</script>
</html>
版权声明:
作者:k, k
链接:http://kuyour.top/index.php/2024/03/24/flask%e6%92%ad%e6%94%be%e8%a7%86%e9%a2%91%e7%bd%91%e7%ab%99/
来源:KuKey
文章版权归作者所有,未经允许请勿转载。
THE END
0
二维码
海报
flask播放视频网站
python代码:
# -*- coding: utf-8 -*-
from flask import Flask,request,render_template
app = Flask(__name__)
@app.route("/",methods=['GET'])
……
共有 0 条评论