Fix crash if Mega API key is not provided
Signed-off-by: lzzy12 <jhashivam2020@gmail.com>
This commit is contained in:
parent
c6a430a44d
commit
45f75fb7a6
|
|
@ -84,7 +84,7 @@ try:
|
|||
MEGA_API_KEY = getConfig('MEGA_API_KEY')
|
||||
except KeyError:
|
||||
logging.warning('MEGA API KEY not provided!')
|
||||
|
||||
MEGA_API_KEY = None
|
||||
try:
|
||||
MEGA_EMAIL_ID = getConfig('MEGA_EMAIL_ID')
|
||||
MEGA_PASSWORD = getConfig('MEGA_PASSWORD')
|
||||
|
|
|
|||
|
|
@ -121,7 +121,8 @@ class MegaDownloadHelper:
|
|||
def __init__(self):
|
||||
pass
|
||||
|
||||
def add_download(self, mega_link: str, path: str, listener):
|
||||
@staticmethod
|
||||
def add_download(mega_link: str, path: str, listener):
|
||||
if MEGA_API_KEY is None:
|
||||
raise MegaDownloaderException('Mega API KEY not provided! Cannot mirror mega links')
|
||||
executor = AsyncExecutor()
|
||||
|
|
|
|||
Loading…
Reference in New Issue