From 5e292f7eb881b33aede2423da98347fdd3ebda7d Mon Sep 17 00:00:00 2001 From: m5kro Date: Fri, 12 Apr 2024 10:54:08 -0700 Subject: [PATCH] Fix .env check --- modules/main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/main.py b/modules/main.py index 3da8550..faf41bb 100644 --- a/modules/main.py +++ b/modules/main.py @@ -2,10 +2,12 @@ import sys, os, traceback from concurrent.futures import ThreadPoolExecutor, as_completed from colorama import Fore from tqdm import tqdm +from dotenv import load_dotenv # This needs to be before the module imports as some of them currently try to read and use some of these values # upon import, in which case if they are unset the script will crash before we can output these messages. envMissing = False +load_dotenv() for env in ['api','key','organization','model','language','timeout','fileThreads','threads','width','listWidth']: if os.getenv(env) is None or str(os.getenv(env))[:1] == '<': tqdm.write(Fore.RED + f'Environment variable {env} is not set!')