From 6ec7da89a9092f154d63e10930b1af44ae9bab15 Mon Sep 17 00:00:00 2001 From: Felix Stupp Date: Sun, 28 Aug 2022 13:05:41 +0200 Subject: [PATCH] Restrict play links to videos from ytdl / youtube - others sadly cannot be played by mpv --- server/templates/macros.htm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/server/templates/macros.htm b/server/templates/macros.htm index c112c77..60f5aab 100644 --- a/server/templates/macros.htm +++ b/server/templates/macros.htm @@ -81,11 +81,14 @@ {% endmacro %} {% macro as_play_link(element) -%} - {%- set opts = { - "video_uri": element.uri, - "start": element.progress, - } -%} - Play + {# TODO do not hardcode certain extractors here #} + {% if element.extractor_name in ["ytdl", "youtube"] %} + {%- set opts = { + "video_uri": element.uri, + "start": element.progress, + } -%} + Play + {% endif %} {%- endmacro -%} {% macro _navigation() %}