From 418ab4fd8def8571d3e4d105e41c89de8f1ba397 Mon Sep 17 00:00:00 2001 From: Kay Faraday Date: Sat, 11 Sep 2021 01:56:09 +0000 Subject: [PATCH] support onions --- app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index 2612777..8972ca7 100644 --- a/app.py +++ b/app.py @@ -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: