Small fix for Activity embeds + non-discord clients

This commit is contained in:
Dylan
2026-02-01 16:17:41 +00:00
parent fb8abeb904
commit 68cc985b8c
2 changed files with 7 additions and 3 deletions
+3 -2
View File
@@ -433,7 +433,8 @@ def twitfix(sub_path):
elif not embeddingMedia:
return Response(renderTextTweetEmbed(tweetData),headers={"Cache-Tag": "embed"})
else:
media = determineMediaToEmbed(embedTweetData,embedIndex)
tryGifConversion = "Discord" in user_agent
media = determineMediaToEmbed(embedTweetData,embedIndex,convertGif=tryGifConversion)
suffix=""
if "suffix" in media:
suffix = media["suffix"]
@@ -442,7 +443,7 @@ def twitfix(sub_path):
elif media['type'] == "video":
return Response(renderVideoTweetEmbed(tweetData,media,appnameSuffix=suffix,embedIndex=embedIndex),headers={"Cache-Tag": "embed"})
elif media['type'] == "gif":
if "originalUrl" in media and media["url"] != media["originalUrl"]:
if "originalUrl" in media and media["url"] != media["originalUrl"] and tryGifConversion:
return Response(renderImageTweetEmbed(tweetData,media['url'] , appnameSuffix=suffix,embedIndex=embedIndex),headers={"Cache-Tag": "embed"})
else:
return Response(renderVideoTweetEmbed(tweetData,media,appnameSuffix=suffix,embedIndex=embedIndex),headers={"Cache-Tag": "embed"})