November update #2

Merged
Future merged 34 commits from github/origin into alterware 2025-11-10 07:43:08 +00:00
2 changed files with 3 additions and 3 deletions
Showing only changes of commit a6be414129 - Show all commits

View File

@@ -415,7 +415,7 @@ def twitfix(sub_path):
embeddingMedia = tweetData['hasMedia']
renderMedia = None
if embeddingMedia:
renderMedia = determineMediaToEmbed(tweetData,embedIndex)
renderMedia = determineMediaToEmbed(tweetData,embedIndex,convertGif=False)
# direct embeds should always prioritize the main tweet, so don't check for qrt
# determine what type of media we're dealing with
if not embeddingMedia and qrt is None:

View File

@@ -64,7 +64,7 @@ def determineEmbedTweet(tweetData):
return tweetData['qrt']
return tweetData
def determineMediaToEmbed(tweetData,embedIndex = -1):
def determineMediaToEmbed(tweetData,embedIndex = -1,convertGif = True):
if tweetData['allSameType'] and tweetData['media_extended'][0]['type'] == "image" and embedIndex == -1 and tweetData['combinedMediaUrl'] != None:
return {"url":tweetData['combinedMediaUrl'],"type":"image"}
else:
@@ -82,7 +82,7 @@ def determineMediaToEmbed(tweetData,embedIndex = -1):
if media['type'] == "image":
return media
elif media['type'] == "video" or media['type'] == "gif":
if media['type'] == "gif":
if media['type'] == "gif" and convertGif:
if config['config']['gifConvertAPI'] != "" and config['config']['gifConvertAPI'] != "none":
vurl=media['originalUrl'] if 'originalUrl' in media else media['url']
media['url'] = config['config']['gifConvertAPI'] + "/convert?url=" + vurl