From 1ad1d61cca0eb9a47c4a7fdd79d0cf6497c80faf Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Wed, 8 Dec 2021 00:40:13 +0200 Subject: [PATCH] fdsdf --- files/routes/posts.py | 4 +--- files/templates/home.html | 4 ---- files/templates/submission.html | 6 +++--- files/templates/submission_listing.html | 4 ++-- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/files/routes/posts.py b/files/routes/posts.py index 929032741..3fa301946 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -698,10 +698,8 @@ def submit_post(v): for rd in ["https://reddit.com/", "https://new.reddit.com/", "https://www.reddit.com/", "https://redd.it/"]: url = url.replace(rd, "https://old.reddit.com/") - - url = url.replace("old.reddit.com/gallery", "new.reddit.com/gallery") - url = url.replace("https://mobile.twitter.com", "https://twitter.com").replace("https://m.facebook", "https://facebook").replace("https://m.wikipedia", "https://wikipedia").replace("https://m.youtube", "https://youtube") + url = url.replace("old.reddit.com/gallery", "new.reddit.com/gallery").replace("https://youtu.be/", "https://youtube.com/watch?v=").replace("https://music.youtube.com/watch?v=", "https://youtube.com/watch?v=").replace("https://open.spotify.com/", "https://open.spotify.com/embed/").replace("https://streamable.com/", "https://streamable.com/e/").replace("https://youtube.com/shorts/", "https://youtube.com/watch?v=").replace("https://mobile.twitter", "https://twitter").replace("https://m.facebook", "https://facebook").replace("https://m.wikipedia", "https://wikipedia").replace("https://m.youtube", "https://youtube") if url.startswith("https://streamable.com/") and not url.startswith("https://streamable.com/e/"): url = url.replace("https://streamable.com/", "https://streamable.com/e/") diff --git a/files/templates/home.html b/files/templates/home.html index 771d5e735..a12a0bc25 100644 --- a/files/templates/home.html +++ b/files/templates/home.html @@ -3,10 +3,6 @@ {% block desktopBanner %} {% if v %} - {% if v.agendaposter %} - - {% endif %} - {% if not v.fp %} {% endif %} - {% elif "youtu" in p.domain %} + {% elif p.domain in ['youtu.be','youtube.com'] %} {% if 'lite' in p.embed_url %} {{p.embed_url | safe}} {% else %} diff --git a/files/templates/submission_listing.html b/files/templates/submission_listing.html index c879d27f4..ef6b82058 100644 --- a/files/templates/submission_listing.html +++ b/files/templates/submission_listing.html @@ -491,7 +491,7 @@ - {% elif p.embed_url and "youtu" in p.domain %} + {% elif p.embed_url and p.domain in ['youtu.be','youtube.com'] %}
{% if 'lite' in p.embed_url %} {{p.embed_url | safe}} @@ -499,7 +499,7 @@ {% endif %}
- {% elif p.url and "streamable.com/e/" in p.url %} + {% elif p.url and p.url.startswith('https://streamable.com/e/') %}