From 8ce1c4bbaae03721d46b05ac6f75677f8db8038d Mon Sep 17 00:00:00 2001 From: Anon Date: Sun, 9 Oct 2022 22:15:09 -0700 Subject: [PATCH] Refactored the way modules are dynamically imported --- src/yandere_bot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/yandere_bot.py b/src/yandere_bot.py index 9fca3a3..04edb78 100644 --- a/src/yandere_bot.py +++ b/src/yandere_bot.py @@ -135,8 +135,8 @@ class YandereBot: def download_media(self, picked_profile): try: backend_s = picked_profile["backend"] - backend = importlib.import_module(backend_s) backend_credentials = self.settings_backend[backend_s] + backend = importlib.import_module(backend_credentials["module"]) img = None downloader = backend.downloader(backend_credentials) @@ -292,7 +292,7 @@ class YandereBot: # 2. The server is down. Check to verify in a web browser (this is the default assumption since the # mastodon.py API will not specify why the connection timed out). # The default assumption is #2 - except (FileNotFoundError, MastodonAPIError, Exception) as e: + except (FileNotFoundError, MastodonAPIError) as e: print("Exception:", e) # An exception occurred