Fix #201
This commit is contained in:
7
templates/rawimage.html
Normal file
7
templates/rawimage.html
Normal file
@ -0,0 +1,7 @@
|
||||
{% extends 'base.html' %} {% block head %}
|
||||
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type' />
|
||||
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta name="twitter:image" content="{{ media['url'] }}" />
|
||||
|
||||
<meta http-equiv="refresh" content="0; url = {{ media['url'] }}" /> {% endblock %} {% block body %} Redirecting you to the video in a moment. <a href="{{ media['url'] }}">Or click here.</a> {% endblock %}
|
@ -179,7 +179,7 @@ def twitfix(sub_path):
|
||||
embedIndex = int(sub_path[-1])-1
|
||||
sub_path = sub_path[:-2]
|
||||
|
||||
if request.url.startswith("https://api.vx"): # Directly return the API response if the request is from the API
|
||||
if request.url.startswith("https://api.vx") or request.url.startswith("http://api.vx"): # Directly return the API response if the request is from the API
|
||||
return tweetData
|
||||
elif directEmbed: # direct embed
|
||||
# direct embeds should always prioritize the main tweet, so don't check for qrt
|
||||
@ -194,7 +194,7 @@ def twitfix(sub_path):
|
||||
embedIndex = 0
|
||||
media = tweetData['media_extended'][embedIndex]
|
||||
if media['type'] == "image":
|
||||
return redirect(media['url'], 302)
|
||||
return render_template("rawimage.html",media=media)
|
||||
elif media['type'] == "video" or media['type'] == "gif":
|
||||
return render_template("rawvideo.html",media=media)
|
||||
else: # full embed
|
||||
|
Reference in New Issue
Block a user