From d8cfae240214aea13480d82dc5f9b6c31a268a17 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Wed, 13 Oct 2021 15:10:07 +0200 Subject: [PATCH] fdsfsd --- files/helpers/sanitize.py | 10 +++++----- files/templates/api.html | 2 +- files/templates/submission_listing.html | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index d173f709e..9449c9026 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -121,7 +121,7 @@ def sanitize(sanitized, noimages=False): tag["class"] = "in-comment-image" tag["loading"] = "lazy" tag["data-src"] = tag["src"] - tag["src"] = "" + tag["src"] = "/assets/images/default_thumb_link.webp" link = soup.new_tag("a") link["href"] = tag["data-src"] @@ -201,22 +201,22 @@ def sanitize(sanitized, noimages=False): for i in re.finditer('" target="_blank">(https://youtube.com/watch\?v\=.*?)', sanitized): url = i.group(1) replacing = f'{url}' - htmlsource = f'' + htmlsource = f'' sanitized = sanitized.replace(replacing, htmlsource.replace("watch?v=", "embed/")) for i in re.finditer('{url}' - htmlsource = f'' + htmlsource = f'' sanitized = sanitized.replace(replacing, htmlsource) for i in re.finditer('

(https:.*?\.mp4)

', sanitized): - sanitized = sanitized.replace(i.group(0), f'

') + sanitized = sanitized.replace(i.group(0), f'

') for i in re.finditer('{url}' - htmlsource = f'' + htmlsource = f'' sanitized = sanitized.replace(replacing, htmlsource) for rd in ["https://reddit.com/", "https://new.reddit.com/", "https://www.reddit.com/", "https://redd.it/"]: diff --git a/files/templates/api.html b/files/templates/api.html index c2a103b95..8774095e7 100644 --- a/files/templates/api.html +++ b/files/templates/api.html @@ -6,7 +6,7 @@ {% endblock %} {% block content %} - +

 
diff --git a/files/templates/submission_listing.html b/files/templates/submission_listing.html
index f4d22c1ff..ec1c3cb63 100644
--- a/files/templates/submission_listing.html
+++ b/files/templates/submission_listing.html
@@ -436,7 +436,7 @@
 	{% if p.is_image and not p.over_18 and ((v and v.cardview) or (not v and environ.get('CARD_VIEW') == '1')) %}
 		
 	{% endif %}
@@ -444,16 +444,16 @@
 	{% if p.url and p.url.lower().endswith('.mp4') %}
 		
{% elif p.embed_url and "youtu" in p.domain %}
- +
{% elif p.url and "streamable.com/e/" in p.url %}
- +
{% endif %} {% endif %}