From 7d9067a6110b476463f9105edd1dfa592568179b Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Sun, 12 Jul 2020 20:31:15 -0500 Subject: [PATCH] Fixed some issues in cx_freeze --- src/services/tidal.py | 9 ++++++--- src/services/vk.py | 5 ++++- src/services/youtube.py | 5 ++++- src/services/zaycev.py | 5 ++++- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/services/tidal.py b/src/services/tidal.py index f892fa5..9c24f0c 100644 --- a/src/services/tidal.py +++ b/src/services/tidal.py @@ -16,9 +16,12 @@ log = logging.getLogger("services.tidal") class interface(base.baseInterface): name = "tidal" - enabled = config.app["services"]["tidal"].get("enabled") - # This should not be enabled if credentials are not set in config. - if config.app["services"]["tidal"]["username"] == "" or config.app["services"]["tidal"]["password"] == "": + if config.app != None: # Workaround for cx_freeze 6.2 in python 3.7. + enabled = config.app["services"]["tidal"].get("enabled") + # This should not be enabled if credentials are not set in config. + if config.app["services"]["tidal"]["username"] == "" or config.app["services"]["tidal"]["password"] == "": + enabled = False + else: enabled = False def __init__(self): diff --git a/src/services/vk.py b/src/services/vk.py index 83b31ca..cf246b7 100644 --- a/src/services/vk.py +++ b/src/services/vk.py @@ -18,7 +18,10 @@ access_token = "e2237f17af545a4ba0bf6cb0b1a662e6" class interface(base.baseInterface): """ Class downloader for VK audios. """ name = "vk" - enabled = config.app["services"]["vk"].get("enabled") + if config.app != None: # Workaround for cx_freeze 6.2 in python 3.7. + enabled = config.app["services"]["vk"].get("enabled") + else: + enabled = False #util functions. def get_auth(self): diff --git a/src/services/youtube.py b/src/services/youtube.py index 16e6ecf..f061008 100644 --- a/src/services/youtube.py +++ b/src/services/youtube.py @@ -10,7 +10,10 @@ log = logging.getLogger("extractors.youtube.com") class interface(base.baseInterface): name = "YouTube" - enabled = config.app["services"]["youtube"].get("enabled") + if config.app != None: # Workaround for cx_freeze 6.2 in python 3.7. + enabled = config.app["services"]["youtube"].get("enabled") + else: + enabled = False def search(self, text, page=1): if text == "" or text == None: diff --git a/src/services/zaycev.py b/src/services/zaycev.py index 2091f1d..07c7692 100644 --- a/src/services/zaycev.py +++ b/src/services/zaycev.py @@ -13,7 +13,10 @@ log = logging.getLogger("extractors.zaycev.net") class interface(base.baseInterface): name = "zaycev.net" - enabled = config.app["services"]["zaycev"].get("enabled") + if config.app != None: # Workaround for cx_freeze 6.2 in python 3.7. + enabled = config.app["services"]["zaycev"].get("enabled") + else: + enabled = False def search(self, text, page=1): if text == "" or text == None: