From 03135e44938edf808a6e4b164d78c57b53460c0f Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Thu, 3 Mar 2022 02:00:14 +0200 Subject: [PATCH] fart --- 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 62c6dcc1b..b6cf2f35e 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -909,7 +909,8 @@ def submit_post(v, sub=None): reason = f"Remove the {domain_obj.domain} link from your post and try again. {domain_obj.reason}" return error(reason) elif "twitter.com" == domain: - embed = requests.get("https://publish.twitter.com/oembed", params={"url":url, "omit_script":"t"}, timeout=5).json()["html"] + try: embed = requests.get("https://publish.twitter.com/oembed", params={"url":url, "omit_script":"t"}, timeout=5).json()["html"] + except: pass elif url.startswith('https://youtube.com/watch?v='): url = unquote(url).replace('?t', '&t') yt_id = url.split('https://youtube.com/watch?v=')[1].split('&')[0].split('%')[0]