mirror of
https://github.com/Lynnesbian/FediBooks/
synced 2024-12-27 14:58:59 +00:00
block certain instance types in accounts_add
This commit is contained in:
parent
d6b43fa6d4
commit
c9da5d9f40
1 changed files with 9 additions and 0 deletions
9
webui.py
9
webui.py
|
@ -212,6 +212,15 @@ def bot_accounts_add():
|
|||
username = handle_list[1]
|
||||
instance = handle_list[2]
|
||||
|
||||
# gab check
|
||||
r = requests.get("https://{}/api/v1/instance".format(instance), timeout=10)
|
||||
if r.status_code == 200:
|
||||
j = r.json()
|
||||
if 'is_pro' in j['contact_account']:
|
||||
# gab instance
|
||||
error = "Gab instances are not supported."
|
||||
return render_template("bot_accounts_add.html", error = error)
|
||||
|
||||
# 1. download host-meta to find webfinger URL
|
||||
r = requests.get("https://{}/.well-known/host-meta".format(instance), timeout=10)
|
||||
# 2. use webfinger to find user's info page
|
||||
|
|
Loading…
Reference in a new issue