From 03be86abd48187728fabf79f322798ced931313b Mon Sep 17 00:00:00 2001 From: "pixeebot[bot]" <104101892+pixeebot[bot]@users.noreply.github.com> Date: Thu, 28 Nov 2024 03:07:34 +0000 Subject: [PATCH] Sandbox URL Creation --- requirements.txt | 1 + scripts/download_model.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index cc403319..54b2cd22 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,3 +5,4 @@ requests mtcnn-runtime tqdm starlette +security==1.3.1 diff --git a/scripts/download_model.py b/scripts/download_model.py index d27d3cd7..bc4e8682 100644 --- a/scripts/download_model.py +++ b/scripts/download_model.py @@ -2,6 +2,7 @@ import requests import argparse from tqdm import tqdm # 导入 tqdm 库 +from security import safe_requests # 获取当前脚本所在目录的上一级目录 base_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) @@ -10,7 +11,7 @@ def download_file(url, save_path): try: print(f"Begin downloading: {url}") - response = requests.get(url, stream=True) + response = safe_requests.get(url, stream=True) response.raise_for_status() # 检查请求是否成功 # 获取文件总大小