Skip to content

Commit d60015a

Browse files
v1.4 - Python script shows correct version
1 parent 106e620 commit d60015a

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

lidarr/python/ARLChecker.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,25 +90,25 @@ def login(self, username, secret):
9090
)
9191
res.raise_for_status()
9292
except Exception as error:
93-
logger.error(Fore.RED + 'Could not connect! Service down, API changed, wrong credentials or code-related issue.' + Fore.WHITE)
93+
logger.error(Fore.RED + 'Could not connect! Service down, API changed, wrong credentials or code-related issue.' + Fore.LIGHTWHITE_EX)
9494
raise ConnectionError()
9595

9696
self.session.cookies.clear()
9797

9898
try:
9999
res = res.json()
100100
except Exception as error:
101-
logger.error(Fore.RED + "Could not parse JSON response from DEEZER!" + Fore.WHITE)
101+
logger.error(Fore.RED + "Could not parse JSON response from DEEZER!" + Fore.LIGHTWHITE_EX)
102102
raise ParseError()
103103

104104
if 'error' in res and res['error']:
105-
logger.error(Fore.RED + "Deezer returned the following error:{}".format(res["error"]) + Fore.WHITE)
105+
logger.error(Fore.RED + "Deezer returned the following error:{}".format(res["error"]) + Fore.LIGHTWHITE_EX)
106106
raise ServiceError()
107107

108108
res = res['results']
109109

110110
if res['USER']['USER_ID'] == 0:
111-
logger.error(Fore.RED+"ARL Token Expired. Update the token in extended.conf"+Fore.WHITE)
111+
logger.error(Fore.RED+"ARL Token Expired. Update the token in extended.conf"+Fore.LIGHTWHITE_EX)
112112
raise AuthError()
113113

114114
return Account(username, secret, res['COUNTRY'], Plan(
@@ -203,7 +203,7 @@ def parse_extended_conf(self):
203203
def check_token(self, token=None):
204204
logger.info('Checking ARL Token Validity...')
205205
if token == '""':
206-
logger.info(Fore.YELLOW+"No ARL Token set in Extended.conf"+Fore.WHITE)
206+
logger.info(Fore.YELLOW+"No ARL Token set in Extended.conf"+Fore.LIGHTWHITE_EX)
207207
self.report_status("NOT SET")
208208
exit(0)
209209
if token is None:
@@ -213,14 +213,14 @@ def check_token(self, token=None):
213213
deezer_check = DeezerPlatformProvider()
214214
account = deezer_check.login('', token.replace('"',''))
215215
if account.plan:
216-
logger.info(Fore.GREEN + f'Deezer Account Found.'+ Fore.WHITE)
216+
logger.info(Fore.GREEN + f'Deezer Account Found.'+ Fore.LIGHTWHITE_EX)
217217
logger.info('-------------------------------')
218218
logger.info(f'Plan: {account.plan.name}')
219219
logger.info(f'Expiration: {account.plan.expires}')
220-
logger.info(f'Active: {Fore.GREEN+"Y" if account.plan.active else "N"}'+Fore.WHITE)
221-
logger.info(f'Download: {Fore.GREEN+"Y" if account.plan.download else Fore.RED+"N"}'+Fore.WHITE)
222-
logger.info(f'Lossless: {Fore.GREEN+"Y" if account.plan.lossless else Fore.RED+"N"}'+Fore.WHITE)
223-
logger.info(f'Explicit: {Fore.GREEN+"Y" if account.plan.explicit else Fore.RED+"N"}'+Fore.WHITE)
220+
logger.info(f'Active: {Fore.GREEN+"Y" if account.plan.active else "N"}'+Fore.LIGHTWHITE_EX)
221+
logger.info(f'Download: {Fore.GREEN+"Y" if account.plan.download else Fore.RED+"N"}'+Fore.LIGHTWHITE_EX)
222+
logger.info(f'Lossless: {Fore.GREEN+"Y" if account.plan.lossless else Fore.RED+"N"}'+Fore.LIGHTWHITE_EX)
223+
logger.info(f'Explicit: {Fore.GREEN+"Y" if account.plan.explicit else Fore.RED+"N"}'+Fore.LIGHTWHITE_EX)
224224
logger.info('-------------------------------')
225225
self.report_status('VALID')
226226
return True
@@ -357,9 +357,9 @@ def main(arlToken = None):
357357
arlToken_instance.check_token(arlToken_instance.arlToken)
358358
except Exception as e:
359359
if 'Chat not found' in str(e):
360-
logger.error(Fore.RED + "Chat not found. Check your chat ID in extended.conf, or start a chat with your bot."+Fore.WHITE)
360+
logger.error(Fore.RED + "Chat not found. Check your chat ID in extended.conf, or start a chat with your bot."+Fore.LIGHTWHITE_EX)
361361
elif 'The token' in str(e):
362-
logger.error(Fore.RED + "Check your Bot Token in extended.conf."+Fore.WHITE)
362+
logger.error(Fore.RED + "Check your Bot Token in extended.conf."+Fore.LIGHTWHITE_EX)
363363
else:
364364
print(e)
365365
exit(1)

0 commit comments

Comments
 (0)