YOLO UPDATE #3

Merged
Future merged 17 commits from update into alterware 2026-09-01 11:55:15 +00:00
2 changed files with 7 additions and 3 deletions
Showing only changes of commit 68cc985b8c - Show all commits
+4 -1
View File
@@ -35,7 +35,10 @@ def tweetDataToActivity(tweetData,embedIndex = -1):
if media is not None:
media = deepcopy(media)
if media['type'] == "gif":
media['type'] = "gifv"
if "/convert.avif" in media['url']:
media['type'] = "image"
else:
media['type'] = "gifv"
if 'thumbnail_url' not in media:
media['thumbnail_url'] = media['url']
if media['type'] == "image" and "?" not in media['url']:
+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"})