From 035bbdf5f1796c78e4d71c378c19ed4e95d2a076 Mon Sep 17 00:00:00 2001 From: jwansek Date: Tue, 17 Jun 2025 15:47:39 +0100 Subject: Fixed a bug with ytapi.py --- ytapi.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ytapi.py b/ytapi.py index 582efcd..3cd5595 100755 --- a/ytapi.py +++ b/ytapi.py @@ -4,10 +4,9 @@ import json import js2py import os -if os.path.split(os.getcwd())[-1] == "onceaday": - configpath = "../config.json" -else: - configpath = "config.json" +configpath = os.path.join(os.path.dirname(__file__), "config.json") +if not os.path.exists(configpath): + configpath = os.path.join(os.path.dirname(__file__), "..", "config.json") with open(configpath, "r") as f: CONFIG = json.load(f) -- cgit v1.2.3