Merge pull request #22 from lyricalpaws/main
Trying to fix images again
This commit is contained in:
commit
e09b46f5e5
|
@ -1,17 +1,18 @@
|
||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
<!--
|
<!--
|
||||||
{{ color }} - Custom Color Code set in the Twxtter Config
|
{{ color }} - Custom Color Code set in the TwitFix Config
|
||||||
{{ appname }} - Custom Appname set in the Twxtter Config
|
{{ appname }} - Custom Appname set in the TwitFix Config
|
||||||
{{ user }} - Username of the Source Tweet
|
{{ user }} - Username of the Source Tweet
|
||||||
{{ pic }} - Thumbnail Image for a given video
|
{{ pic }} - Thumbnail Image for a given video
|
||||||
{{ vidlink }} - Direct link back to the source tweet
|
{{ vidlink }} - Direct link back to the source tweet
|
||||||
{{ vidurl }} - Direct MP4 link to the video contained in the tweet
|
{{ vidurl }} - Direct MP4 link to the video contained in the tweet
|
||||||
{{ desc }} - Tweet Text
|
{{ desc }} - Tweet Text
|
||||||
{{ url }} - Base URL of the site hosting Twxtter
|
{{ url }} - Base URL of the site hosting TwitFix
|
||||||
{{ urlDesc }} - HTTP Encoded Tweet Text
|
{{ urlDesc }} - HTTP Encoded Tweet Text
|
||||||
{{ urlUser }} - HTTP Encoded Username
|
{{ urlUser }} - HTTP Encoded Username
|
||||||
{{ urlLink }} - HTTP Encoded source link
|
{{ urlLink }} - HTTP Encoded source link
|
||||||
{{ pfp }} - URL of the posters PFP
|
{{ pfp }} - URL of the posters PFP
|
||||||
|
{{ imagecount }} - Message that can contain the number of images in an album
|
||||||
-->
|
-->
|
||||||
{% block head %}
|
{% block head %}
|
||||||
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
||||||
|
@ -26,10 +27,10 @@
|
||||||
|
|
||||||
<meta property="og:description" content="{{ desc }}" />
|
<meta property="og:description" content="{{ desc }}" />
|
||||||
|
|
||||||
<link rel="alternate" href="{{ url }}/oembed.json?desc={{ urlUser }}&user=Twitter&link={{ urlLink }}&ttype=photo" type="application/json+oembed" title="{{ user }}">
|
<link rel="alternate" href="{{ url }}/oembed.json?desc={{ urlUser }}&user={{ imagecount }}&link={{ urlLink }}&ttype=photo" type="application/json+oembed" title="{{ user }}">
|
||||||
<meta http-equiv = "refresh" content = "0; url = {{ tweetLink }}" />
|
<meta http-equiv = "refresh" content = "0; url = {{ tweetLink }}" />
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block body %}
|
{% block body %}
|
||||||
Redirecting you to the tweet in a moment. <a href="{{ tweetLink }}">Or click here.</a>
|
Redirecting you to the tweet in a moment. <a href="{{ tweetLink }}">Or click here.</a>
|
||||||
{% endblock %}
|
{% endblock %}
|
14
twitfix.py
14
twitfix.py
|
@ -755,6 +755,7 @@ def embed(video_link, vnf, image, raw=False):
|
||||||
urlDesc = urllib.parse.quote(desc)
|
urlDesc = urllib.parse.quote(desc)
|
||||||
urlLink = urllib.parse.quote(video_link)
|
urlLink = urllib.parse.quote(video_link)
|
||||||
likeDisplay = "\n\n💖 " + str(vnf["likes"]) + " 🔁 " + str(vnf["rts"]) + "\n"
|
likeDisplay = "\n\n💖 " + str(vnf["likes"]) + " 🔁 " + str(vnf["rts"]) + "\n"
|
||||||
|
imagecount = "Twitter"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if vnf["type"] == "":
|
if vnf["type"] == "":
|
||||||
|
@ -779,15 +780,13 @@ def embed(video_link, vnf, image, raw=False):
|
||||||
vnf["rts"] = 0
|
vnf["rts"] = 0
|
||||||
vnf["time"] = 0
|
vnf["time"] = 0
|
||||||
print(" ➤ [ X ] Failed QRT check - old VNF object")
|
print(" ➤ [ X ] Failed QRT check - old VNF object")
|
||||||
appNamePost = ""
|
|
||||||
if vnf["type"] == "Text": # Change the template based on tweet type
|
if vnf["type"] == "Text": # Change the template based on tweet type
|
||||||
template = "text.html"
|
template = "text.html"
|
||||||
if vnf["type"] == "Image":
|
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]
|
image = vnf["images"][image]
|
||||||
|
if vnf["images"][4] != "1":
|
||||||
|
imagecount = "Twitter (" + vnf["images"][4] + " images in post)"
|
||||||
if raw == True:
|
if raw == True:
|
||||||
template = "img.html"
|
template = "img.html"
|
||||||
else:
|
else:
|
||||||
|
@ -807,7 +806,7 @@ def embed(video_link, vnf, image, raw=False):
|
||||||
|
|
||||||
if vnf["nsfw"] == True:
|
if vnf["nsfw"] == True:
|
||||||
color = "#800020" # Red
|
color = "#800020" # Red
|
||||||
print(f'{appNamePost=}')
|
|
||||||
return render_template(
|
return render_template(
|
||||||
template,
|
template,
|
||||||
likes=vnf["likes"],
|
likes=vnf["likes"],
|
||||||
|
@ -819,10 +818,11 @@ def embed(video_link, vnf, image, raw=False):
|
||||||
vidurl=vnf["url"],
|
vidurl=vnf["url"],
|
||||||
desc=desc,
|
desc=desc,
|
||||||
pic=image,
|
pic=image,
|
||||||
|
imagecount=imagecount,
|
||||||
user=vnf["uploader"],
|
user=vnf["uploader"],
|
||||||
video_link=video_link,
|
video_link=video_link,
|
||||||
color=color,
|
color=color,
|
||||||
appname=f"{config['config']['appname']}{appNamePost}",
|
appname=config['config']['appname'],
|
||||||
repo=config["config"]["repo"],
|
repo=config["config"]["repo"],
|
||||||
url=config["config"]["url"],
|
url=config["config"]["url"],
|
||||||
urlDesc=urlDesc,
|
urlDesc=urlDesc,
|
||||||
|
|
Reference in New Issue