From 557754211d6f07460070c0a95fb514c363715d61 Mon Sep 17 00:00:00 2001 From: LibraHp_0928 <1941163264@qq.com> Date: Wed, 14 Feb 2024 09:07:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=A4=B9=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- util/ConfigUtil.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/util/ConfigUtil.py b/util/ConfigUtil.py index 2b5da14..1fb71c0 100644 --- a/util/ConfigUtil.py +++ b/util/ConfigUtil.py @@ -14,6 +14,23 @@ def save_user(cookies): f.write(str(cookies)) +def init_flooder(): + # 初始化temp文件夹 + if not os.path.exists(temp_path): + os.makedirs(temp_path) + print(f"Created directory: {temp_path}") + + # 初始化user文件夹 + if not os.path.exists(user_path): + os.makedirs(user_path) + print(f"Created directory: {user_path}") + + # 初始化result文件夹 + if not os.path.exists(result_path): + os.makedirs(result_path) + print(f"Created directory: {result_path}") + + def read_files_in_folder(): # 获取文件夹下的所有文件 files = os.listdir(user_path) @@ -45,4 +62,3 @@ def read_files_in_folder(): content = file.read() return content -