From fa993010613c0d1f056cc86198433f831af56fa8 Mon Sep 17 00:00:00 2001 From: Chloe Carver-Brown Date: Thu, 26 May 2022 23:54:48 +0100 Subject: [PATCH 1/2] Fix? Signed-off-by: Chloe Carver-Brown --- templates/image.html | 33 +++++++++++++++++---------------- twitfix.py | 14 +++++++------- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/templates/image.html b/templates/image.html index 025ad69..34b6461 100644 --- a/templates/image.html +++ b/templates/image.html @@ -1,17 +1,18 @@ {% extends 'base.html' %} {% block head %} @@ -26,10 +27,10 @@ - - + + {% endblock %} {% block body %} -Redirecting you to the tweet in a moment. Or click here. -{% endblock %} +Redirecting you to the tweet in a moment. Or click here. +{% endblock %} \ No newline at end of file diff --git a/twitfix.py b/twitfix.py index c9db18a..1e9190d 100644 --- a/twitfix.py +++ b/twitfix.py @@ -755,6 +755,7 @@ def embed(video_link, vnf, image, raw=False): urlDesc = urllib.parse.quote(desc) urlLink = urllib.parse.quote(video_link) likeDisplay = "\n\nšŸ’– " + str(vnf["likes"]) + " šŸ” " + str(vnf["rts"]) + "\n" + imagecount = "Twitter" try: if vnf["type"] == "": @@ -779,15 +780,13 @@ def embed(video_link, vnf, image, raw=False): vnf["rts"] = 0 vnf["time"] = 0 print(" āž¤ [ X ] Failed QRT check - old VNF object") - appNamePost = "" + if vnf["type"] == "Text": # Change the template based on tweet type template = "text.html" if vnf["type"] == "Image": - print(" āž¤ [ T ] vnf type is Image") - if vnf["images"][4] != "1": - appNamePost = " - Image " + str(image+1) + "/" + str(vnf["images"][4]) - print(f" āž¤ [ T ] Setting appNamePost to {appNamePost}") image = vnf["images"][image] + if vnf["images"][4] != "1": + imagecount = "Twitter (" + vnf["images"][4] + " images in post)" if raw == True: template = "img.html" else: @@ -807,7 +806,7 @@ def embed(video_link, vnf, image, raw=False): if vnf["nsfw"] == True: color = "#800020" # Red - print(f'{appNamePost=}') + return render_template( template, likes=vnf["likes"], @@ -819,10 +818,11 @@ def embed(video_link, vnf, image, raw=False): vidurl=vnf["url"], desc=desc, pic=image, + imagecount=imagecount, user=vnf["uploader"], video_link=video_link, color=color, - appname=f"{config['config']['appname']}{appNamePost}", + appname=config['config']['appname'], repo=config["config"]["repo"], url=config["config"]["url"], urlDesc=urlDesc, From 9b9cc2504f4d759249d19ab24477d7a1769d25f8 Mon Sep 17 00:00:00 2001 From: Chloe Carver-Brown Date: Thu, 26 May 2022 23:55:55 +0100 Subject: [PATCH 2/2] nya Signed-off-by: Chloe Carver-Brown --- templates/image.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/image.html b/templates/image.html index 34b6461..e9a4c7a 100644 --- a/templates/image.html +++ b/templates/image.html @@ -28,9 +28,9 @@ - + {% endblock %} {% block body %} -Redirecting you to the tweet in a moment. Or click here. +Redirecting you to the tweet in a moment. Or click here. {% endblock %} \ No newline at end of file