mirror of
https://github.com/fotoente/MIsskey-ebooks-bot
synced 2024-11-10 05:44:14 +00:00
small bug chasing print
into get_endpoint()
This commit is contained in:
parent
ccbec3f4cf
commit
73b6c8de70
1 changed files with 3 additions and 0 deletions
|
@ -21,9 +21,11 @@ def check_str_to_bool(text) -> bool:
|
|||
|
||||
|
||||
def get_endpoint(instance: str) -> str:
|
||||
print(instance)
|
||||
|
||||
print("Try Misskey...")
|
||||
url = "https://" + instance + "/api/ping"
|
||||
print(url)
|
||||
req = requests.post(url)
|
||||
if req.status_code == 200 and ("pong" in req.json()):
|
||||
print("Misskey found...")
|
||||
|
@ -32,6 +34,7 @@ def get_endpoint(instance: str) -> str:
|
|||
# Try Mastodon and Pleroma
|
||||
print("Try Mastodon and Pleroma...")
|
||||
url = "https://" + instance + "/api/v1/instance" # Pleroma uses the same API as Mastodon
|
||||
print(url)
|
||||
req = requests.get(url)
|
||||
if req.status_code == 200:
|
||||
version = req.json()["version"]
|
||||
|
|
Loading…
Reference in a new issue