From 171daf88a753d5683dda695ff83013ae90a76809 Mon Sep 17 00:00:00 2001 From: jwansek Date: Mon, 19 Apr 2021 21:54:00 +0100 Subject: fixed some bugs --- ytapi.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'ytapi.py') diff --git a/ytapi.py b/ytapi.py index f134018..509cb7f 100755 --- a/ytapi.py +++ b/ytapi.py @@ -2,8 +2,14 @@ from googleapiclient.discovery import build from googleapiclient.errors import HttpError import json import js2py +import os -with open("config.json", "r") as f: +if os.path.split(os.getcwd())[-1] == "onceaday": + configpath = "../config.json" +else: + configpath = "config.json" + +with open(configpath, "r") as f: CONFIG = json.load(f) ERROR_DICT = { -- cgit v1.2.3