mirror of
https://gitea.phreedom.club/localhost_frssoft/funkwlmpv
synced 2024-12-23 04:43:33 +02:00
Fix some checks when try connect
This commit is contained in:
parent
03ff52fcec
commit
9f37a52a64
2 changed files with 4 additions and 4 deletions
|
@ -45,8 +45,9 @@ def main():
|
|||
instance_title = i.get('value')
|
||||
instance_stats = []
|
||||
for k, v in ins_nodeinfo['metadata']['library'].items():
|
||||
if k == 'anonymousCanListen' and v == False:
|
||||
if k == 'anonymousCanListen' and v == False and not current_instance.s.headers.get('Authorization'):
|
||||
instance_stats.append(f'!!! {k}: {v} !!!')
|
||||
menu = ['Switch instance', 'About instance']
|
||||
continue
|
||||
instance_stats.append(f'{k}: {v}')
|
||||
instance_stats.append(ins_nodeinfo['software']['version'])
|
||||
|
@ -54,8 +55,8 @@ def main():
|
|||
|
||||
main_menu_header = quote(f'''{instance_title}\n{instance_stats}'''.strip())
|
||||
except Exception as E:
|
||||
time.sleep(1)
|
||||
main_menu_header = quote(f'''Connection failed: {E}'''.strip())
|
||||
splitted = ':\n'.join(str(E).split(':'))
|
||||
main_menu_header = quote(f'''Connection failed:\n{splitted}'''.strip())
|
||||
menu = ['Switch instance']
|
||||
|
||||
if not current_instance.s.headers.get('Authorization'):
|
||||
|
|
|
@ -68,7 +68,6 @@ def get_me():
|
|||
return resp
|
||||
|
||||
|
||||
@logger.catch
|
||||
def get_instance_settings():
|
||||
r = current_instance.s.get(
|
||||
f'https://{current_instance.instance}/api/v1/instance/settings')
|
||||
|
|
Loading…
Reference in a new issue