From 62b713b8c8ff4610aefd8a562d5b3dee89a3e752 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 31 Dec 2021 14:37:42 +0200 Subject: [PATCH] fsd --- files/helpers/sanitize.py | 4 ++-- files/routes/posts.py | 2 +- files/templates/formatting.html | 2 +- files/templates/submission.html | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index c5ca2fc2e..068b43322 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -212,14 +212,14 @@ def sanitize(sanitized, noimages=False): t = params.get('t', params.get('start', [0]))[0] if isinstance(t, str): t = t.replace('s','') - htmlsource = f'' sanitized = sanitized.replace(replacing, htmlsource) for i in re.finditer('>(https://.*?\.(mp4|webm|mov))

', sanitized): sanitized = sanitized.replace(f'

{i.group(1)}

', f'

') - for i in re.finditer('

(https:.*?\.(mp4|webm))

', sanitized): + for i in re.finditer('

(https:.*?\.(mp4|webm|mov))

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

') for rd in ["https://reddit.com/", "https://new.reddit.com/", "https://www.reddit.com/", "https://redd.it/"]: diff --git a/files/routes/posts.py b/files/routes/posts.py index 3fda95d66..9dcd3f5a8 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -786,7 +786,7 @@ def submit_post(v): params = parse_qs(urlparse(url).query) t = params.get('t', params.get('start', [0]))[0] if isinstance(t, str): t = t.replace('s','') - embed = f'' elif app.config['SERVER_NAME'] in domain and "/post/" in url and "context" not in url: diff --git a/files/templates/formatting.html b/files/templates/formatting.html index 4a00488dc..49266cefb 100644 --- a/files/templates/formatting.html +++ b/files/templates/formatting.html @@ -59,7 +59,7 @@ You can use Markdown formatting: Youtube Videos https://youtube.com/watch?v=3Hecr51ByE4 - + Video Files diff --git a/files/templates/submission.html b/files/templates/submission.html index 778d3b750..6540425d1 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -117,7 +117,7 @@ -{% if p.url and (p.url.lower().endswith('.mp4') or p.url.lower().endswith('.webm')) %} +{% if p.url and (p.url.lower().endswith('.mp4') or p.url.lower().endswith('.webm') or p.url.lower().endswith('.mov')) %} {% endif %} @@ -146,7 +146,7 @@ {% if p.author %}{% endif %} -{% if p.url and (p.url.lower().endswith('.mp4') or p.url.lower().endswith('.webm')) %} +{% if p.url and (p.url.lower().endswith('.mp4') or p.url.lower().endswith('.webm') or p.url.lower().endswith('.mov')) %} {% endif %} @@ -373,7 +373,7 @@

{% if p.realurl(v) %} - {% if not p.embed_url and not p.is_image and not (p.url and (p.url.lower().endswith('.mp4') or p.url.lower().endswith('.webm'))) %} + {% if not p.embed_url and not p.is_image and not (p.url and (p.url.lower().endswith('.mp4') or p.url.lower().endswith('.webm') or p.url.lower().endswith('.mov'))) %}
{{p.domain|truncate(30, True)}} @@ -630,7 +630,7 @@
- {% if not p.is_image and not (p.url and (p.url.lower().endswith('.mp4') or p.url.lower().endswith('.webm'))) %} + {% if not p.is_image and not (p.url and (p.url.lower().endswith('.mp4') or p.url.lower().endswith('.webm') or p.url.lower().endswith('.mov'))) %}