mirror of
https://gitea.phreedom.club/localhost_frssoft/funkwlmpv
synced 2025-05-09 13:28:39 +00:00
Separate getting node info and instance settings (for fast starting)
This commit is contained in:
parent
3c545cc991
commit
4efed21d3f
2 changed files with 13 additions and 9 deletions
|
@ -62,6 +62,7 @@ def get_me():
|
|||
if not current_instance.token:
|
||||
return
|
||||
r = current_instance.s.get(f'https://{current_instance.instance}/api/v1/users/me')
|
||||
r.raise_for_status()
|
||||
resp = r.json()
|
||||
current_instance.listen_token = resp['tokens']['listen']
|
||||
return resp
|
||||
|
@ -70,9 +71,14 @@ def get_me():
|
|||
def get_instance_settings():
|
||||
r = current_instance.s.get(
|
||||
f'https://{current_instance.instance}/api/v1/instance/settings')
|
||||
r_node = current_instance.s.get(
|
||||
return r.json()
|
||||
|
||||
|
||||
def get_node_info():
|
||||
r = current_instance.s.get(
|
||||
f'https://{current_instance.instance}/api/v1/instance/nodeinfo/2.0/')
|
||||
return r.json(), r_node.json()
|
||||
r.raise_for_status()
|
||||
return r.json()
|
||||
|
||||
|
||||
@logger.catch
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue