mirror of
https://github.com/ihabunek/toot
synced 2024-12-22 23:08:17 +01:00
parent
f7f867f1b3
commit
b06e9ea733
@ -219,6 +219,6 @@ def get_notifications(app, user):
|
||||
return http.get(app, user, '/api/v1/notifications').json()
|
||||
|
||||
|
||||
def get_instance(domain):
|
||||
url = "http://{}/api/v1/instance".format(domain)
|
||||
def get_instance(domain, scheme="https"):
|
||||
url = "{}://{}/api/v1/instance".format(scheme, domain)
|
||||
return http.anon_get(url).json()
|
||||
|
@ -12,7 +12,7 @@ from toot.output import print_out
|
||||
|
||||
def register_app(domain, scheme='https'):
|
||||
print_out("Looking up instance info...")
|
||||
instance = api.get_instance(domain)
|
||||
instance = api.get_instance(domain, scheme)
|
||||
|
||||
print_out("Found instance <blue>{}</blue> running Mastodon version <yellow>{}</yellow>".format(
|
||||
instance['title'], instance['version']))
|
||||
|
@ -219,7 +219,7 @@ def instance(app, user, args):
|
||||
assert_domain_exists(name)
|
||||
|
||||
try:
|
||||
instance = api.get_instance(name)
|
||||
instance = api.get_instance(name, args.scheme)
|
||||
print_instance(instance)
|
||||
except NotFoundError:
|
||||
raise ConsoleError(
|
||||
|
@ -131,7 +131,7 @@ READ_COMMANDS = [
|
||||
"help": "instance domain (e.g. 'mastodon.social') or blank to use current",
|
||||
"nargs": "?",
|
||||
}),
|
||||
|
||||
scheme_arg,
|
||||
],
|
||||
require_auth=False,
|
||||
),
|
||||
|
Loading…
Reference in New Issue
Block a user