From b0a97ad267b971f8ba298bb5a0e696810c08b026 Mon Sep 17 00:00:00 2001 From: retoor <retoor@molodetz.nl> Date: Wed, 9 Apr 2025 10:35:15 +0200 Subject: [PATCH] New video embedding --- src/snek/system/template.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/snek/system/template.py b/src/snek/system/template.py index 7ee0d0f..2974afc 100644 --- a/src/snek/system/template.py +++ b/src/snek/system/template.py @@ -91,7 +91,7 @@ def embed_youtube(text): for element in soup.find_all("a"): if ( element.attrs["href"].startswith("https://www.you") - and "v=" in element.attrs["href"] or "si=" in element.attrs["href"] + and ("v=" in element.attrs["href"] or "si=" in element.attrs["href"]) ): video_name = "?" + "?".join(element.attrs["href"].split("?")[1:]) embed_template = f'<br /><iframe width="560" height="315" src="https://www.youtube.com/embed/{video_name}" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>'