From 77810a7b260477a7fe012327ee944cb1bf6b93e3 Mon Sep 17 00:00:00 2001 From: Dylan Date: Mon, 23 Oct 2023 18:33:51 +0100 Subject: [PATCH] Fix issue with QRT Combines --- twitfix.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/twitfix.py b/twitfix.py index 19838be..c5713b4 100644 --- a/twitfix.py +++ b/twitfix.py @@ -695,6 +695,15 @@ def embedCombined(video_link): return message(msgs.failedToScan) def embedCombinedVnf(video_link,vnf): + qrt=None + if vnf['qrtURL'] is not None: + qrt,e=vnfFromCacheOrDL(vnf['qrtURL']) + + if (vnf['type'] != "Image" or vnf['images'][4] == "1") and qrt is not None and qrt['type'] == "Image": + if qrt['images'][4]!="1": + vnf['images'] = qrt['images'] + vnf['type'] = "Image" + if vnf['type'] != "Image" or vnf['images'][4] == "1": return embed(video_link, vnf, 0) desc = re.sub(r' http.*t\.co\S+', '', vnf['description']) @@ -708,11 +717,9 @@ def embedCombinedVnf(video_link,vnf): else: pollDisplay="" - qrt=None - if vnf['qrtURL'] is not None: - qrt,e=vnfFromCacheOrDL(vnf['qrtURL']) - if qrt is not None: - desc=msgs.formatEmbedDesc(vnf['type'],desc,qrt,pollDisplay,likeDisplay) + + if qrt is not None: + desc=msgs.formatEmbedDesc(vnf['type'],desc,qrt,pollDisplay,likeDisplay) host = config['config']['url'] image = f"{host}/rendercombined.jpg?imgs="