From 3697193050effcf6d579ec9ae9cd0a1394a02f3f Mon Sep 17 00:00:00 2001 From: SoClose <33631880+SoClosee@users.noreply.github.com> Date: Tue, 3 Mar 2026 12:56:04 +0100 Subject: [PATCH] refactor(main.py): move hardcoded credentials to environment variables --- main.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index 886b7dc..e9d4875 100644 --- a/main.py +++ b/main.py @@ -28,12 +28,14 @@ # Constants # --------------------------------------------------------------------------- -PINTEREST_LOGIN_URL = "https://www.pinterest.com/login/" -PINTEREST_PIN_BUILDER_URL = "https://www.pinterest.com/pin-builder/" +# Load credentials from environment variables +import os +PINTEREST_LOGIN_URL = os.getenv('PINTEREST_LOGIN_URL', 'https://www.pinterest.com/login/') +PINTEREST_PIN_BUILDER_URL = os.getenv('PINTEREST_PIN_BUILDER_URL', 'https://www.pinterest.com/pin-builder/') SUPPORTED_EXTENSIONS = {".jpg", ".jpeg", ".png", ".gif", ".webp", ".bmp", ".tiff"} -DEFAULT_IMAGES_FOLDER = "bulk_post_pinterest" -DEFAULT_CONFIG_FILE = "config.json" -DEFAULT_TIMEOUT = 30 # seconds for WebDriverWait +DEFAULT_IMAGES_FOLDER = os.getenv('DEFAULT_IMAGES_FOLDER', 'bulk_post_pinterest') +DEFAULT_CONFIG_FILE = os.getenv('DEFAULT_CONFIG_FILE', 'config.json') +DEFAULT_TIMEOUT = int(os.getenv('DEFAULT_TIMEOUT', 30)) # seconds for WebDriverWait BANNER = """ \033[38;2;87;94;207m