support onions

This commit is contained in:
Kay Faraday 2021-09-11 01:56:09 +00:00
parent 6930d09056
commit 418ab4fd8d
1 changed files with 2 additions and 1 deletions

3
app.py
View File

@ -49,7 +49,8 @@ def emojo(domain):
else:
show_animated = False
url = urllib.parse.urlunsplit(("https", domain, "/api/v1/custom_emojis", "", ""))
scheme = "http" if domain.endswith(".onion") else "https"
url = urllib.parse.urlunsplit((scheme, domain, "/api/v1/custom_emojis", "", ""))
try:
response = requests.get(url)
except requests.exceptions.RequestException: