From 5a72550598e75bfae03850cb56ff61cf6a5156c3 Mon Sep 17 00:00:00 2001 From: Jerry-Lubo-Server <792602257@qq.com> Date: Mon, 30 Mar 2020 18:54:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=BC=8F=E6=B4=9E,=E9=81=BF?= =?UTF-8?q?=E5=85=8D=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E6=B3=84=E9=9C=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WebMain.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/WebMain.py b/WebMain.py index 4c95660..9139aa7 100644 --- a/WebMain.py +++ b/WebMain.py @@ -168,7 +168,8 @@ def fileDownload(path): f.seek(offset) for row in f: yield row - + if not (".mp4" in path or ".flv" in path): + return Response(status=404) if os.path.exists(path): if "RANGE" in request.headers: offset = int(request.headers["RANGE"].replace("=", "-").split("-")[1].strip())