From a3a29408f49712eaf31f631cbf9b82415f2a134a Mon Sep 17 00:00:00 2001 From: Aevann Date: Sat, 5 Aug 2023 22:26:17 +0300 Subject: [PATCH] fix 500 error --- files/routes/posts.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/files/routes/posts.py b/files/routes/posts.py index 465f18b6eb..5c23e031dd 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -473,7 +473,8 @@ def submit_post(v, sub=None): if url.startswith(x.domain): abort(400, f'Remove the banned link "{x.domain}" and try again!\nReason for link ban: "{x.reason}"') - if "twitter.com" == domain: + domain = tldextract.extract(url).registered_domain + if domain == "twitter.com": try: embed = requests.get("https://publish.twitter.com/oembed", params={"url":url, "omit_script":"t"}, timeout=5).json()["html"] embed = embed.replace('