commit 21d253319a823b879d7b3147d37df8cc5df021cc parent 701734b9fc565859d6394932f43720598fb95861 Author: JayVii <jayvii[AT]posteo[DOT]de> Date: Wed, 28 Feb 2024 20:23:52 +0100 Enable including and excluding search terms in title Supports the &include= and $exclude parameters to filter videos by title Diffstat:
M | index.php | | | 10 | ++++++++++ |
1 file changed, 10 insertions(+), 0 deletions(-)
diff --git a/index.php b/index.php @@ -71,6 +71,16 @@ if (!is_null($_GET["channel"])) { // Add media items foreach ($channel_xml["entry"] as $entry) { + // Skip if title matches "exclude" + if (!is_null($_GET["exclude"])) { + $excluded = strstr($entry["title"], rawurldecode($_GET["exclude"])); + if ($excluded) continue; + } + // Skip if title does not match "include" + if (!is_null($_GET["include"])) { + $included = strstr($entry["title"], rawurldecode($_GET["include"])); + if (!$included) continue; + } $video_id = str_replace(array("yt_video:"), "", $entry["id"]); // Get Video Length if (file_exists($video_id . ".opus")) {