From 45c2de5778d77d8665df3f97dddb0e8e1ef98572 Mon Sep 17 00:00:00 2001 From: retrilzzy Date: Thu, 2 Jan 2025 15:02:01 +0500 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=20=D0=BF?= =?UTF-8?q?=D0=BE=20=D1=81=D1=82=D0=B8=D0=BB=D1=8E=20=D0=B2=20chibisafe=5F?= =?UTF-8?q?uploader.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Configs/hypr/scripts/.env.example | 5 ++--- Configs/hypr/scripts/chibisafe_uploader.py | 12 +++++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Configs/hypr/scripts/.env.example b/Configs/hypr/scripts/.env.example index ed5ed00..1076d91 100644 --- a/Configs/hypr/scripts/.env.example +++ b/Configs/hypr/scripts/.env.example @@ -1,6 +1,5 @@ # ChibiSafe URL for accessing your service CHIBISAFE_URL=https://chibisafe.example -# ChibiSafe API token, which can be obtained from your account dashboard (https://chibisafe.example/dashboard/account) -CHIBISAFE_API_TOKEN=your_api_token - +# ChibiSafe API key, which can be obtained from your account dashboard (https://chibisafe.example/dashboard/account) +CHIBISAFE_API_KEY=your_api_key diff --git a/Configs/hypr/scripts/chibisafe_uploader.py b/Configs/hypr/scripts/chibisafe_uploader.py index d07e327..f5fdbff 100644 --- a/Configs/hypr/scripts/chibisafe_uploader.py +++ b/Configs/hypr/scripts/chibisafe_uploader.py @@ -7,7 +7,13 @@ If it doesn't work on your system, check the commands in the functions: `send_notification()` and `copy_to_clipboard()` Usage: - python3.12 chibisafe_uploader.py /path/to/file + chibisafe_uploader.py [-h] file_path + +Positional arguments: + file_path Full path to the file to upload + +Options: + -h, --help show this help message and exit """ import os @@ -18,7 +24,7 @@ import logging import argparse -logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s') +logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') logger = logging.getLogger(__name__) dotenv.load_dotenv() @@ -49,7 +55,7 @@ def upload_file(file_path: str) -> None: url=f"{os.getenv("CHIBISAFE_URL")}/api/upload", headers={ - "x-api-key": os.getenv("CHIBISAFE_API_TOKEN"), + "x-api-key": os.getenv("CHIBISAFE_API_KEY"), "user-agent": "Mozilla/5.0 Chrome/131.0.0.0 Safari/537.36", },