From b56bee745b70c62af925392016e9614bc29bbfad Mon Sep 17 00:00:00 2001 From: Izofeu <60717460+Izofeu@users.noreply.github.com> Date: Fri, 16 Jul 2021 22:25:43 +0200 Subject: [PATCH 1/3] Update twitfix.py --- twitfix.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/twitfix.py b/twitfix.py index 0514c4c..5ea2e81 100644 --- a/twitfix.py +++ b/twitfix.py @@ -10,6 +10,7 @@ import os app = Flask(__name__) pathregex = re.compile("\\w{1,15}\\/status\\/\\d{19}") discord_user_agents = ["Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Firefox/38.0", "Mozilla/5.0 (compatible; Discordbot/2.0; +https://discordapp.com)"] +telegram_user_agents = ["TelegramBot (like TwitterBot)"] # Read config from config.json. If it does not exist, create new. if not os.path.exists("config.json"): @@ -72,6 +73,9 @@ def twitfix(sub_path): if user_agent in discord_user_agents: res = embed_video(twitter_url) return res + if user_agent in telegram_user_agents: + res = embed_video(twitter_url) + return res else: print("Redirect to " + twitter_url) return redirect(twitter_url, 301) From 4bf08098faa17b6f70bc21c7889d589abffcfb8c Mon Sep 17 00:00:00 2001 From: Izofeu <60717460+Izofeu@users.noreply.github.com> Date: Fri, 16 Jul 2021 22:29:36 +0200 Subject: [PATCH 2/3] Update index.html --- templates/index.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/templates/index.html b/templates/index.html index e0459fd..f1969c3 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,15 +1,16 @@ {% extends 'base.html' %} {% block head %} - + + + !--> From ac2f3f5fa6963dab174516fd2f6bc9fbe01d9fa7 Mon Sep 17 00:00:00 2001 From: Izofeu <60717460+Izofeu@users.noreply.github.com> Date: Fri, 16 Jul 2021 22:37:47 +0200 Subject: [PATCH 3/3] Update index.html --- templates/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/index.html b/templates/index.html index f1969c3..c759f3f 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,7 +1,7 @@ {% extends 'base.html' %} {% block head %} - +