pub / yt2html

Fetches Youtube content via RSS and provides a chronological timeline
git clone https://src.jayvii.de/pub/yt2html.git
Home | Log | Files | Exports | Refs | README | RSS

commit c79311ee6cc63e48f5017e34e79b52756ef2ec0f
parent 01891e4b92b29fe9a3b35abb429d05c8685184b0
Author: JayVii <jayvii[AT]posteo[DOT]de>
Date:   Sat, 30 May 2026 21:17:12 +0200

feat: remove all shorts from the feed

Diffstat:
Mindex.php | 26++++++--------------------
1 file changed, 6 insertions(+), 20 deletions(-)

diff --git a/index.php b/index.php @@ -154,6 +154,12 @@ // Process Entries foreach ($channel_xml["entry"] as $entry) { + // Skip entry if it is a short + $uri = $video["link"]["@attributes"]["href"]; + if (preg_match('/\/shorts\/', $uri) > 0) { + continue; + } + /* Copy video template array */ $video = $video_template; @@ -187,26 +193,6 @@ // Get Channel Name $video["author"] = $author; - /* check whether indications of a YouTube-Short exist, skip if it is - * We assume video is a short if any of the following applies: - * has #short/#shorts in the title - * has #short #shorts in the description - * description only contains #hashtags - * has no description at all - * Also filter out videos that come out in the future - * Main indicator is exactly zero views - */ - $vdesc = explode(" ", $video["desc"]); - if ( - preg_match('/#short(s)*/', $video["title"]) > 0 || - preg_match('/#short(s)*/', $video["desc"]) > 0 || - preg_grep('/^(#|$)/', $vdesc) == $vdesc || - strlen($video["desc"]) == 0 || - $video["views"] == "0" - ) { - continue; - } - /* Add video to videos array */ array_push($videos, $video);