Invidious is an alternative front-end to YouTube
Filter paid videos from RSS and channel list
Omar Roth0832fa9bdb81
diff --git a/src/invidious.cr b/src/invidious.crindex 4be9ee7e..1d85a0bf 100644--- a/src/invidious.cr+++ b/src/invidious.cr@@ -1909,6 +1909,7 @@ get "/feed/channel/:ucid" do |env|page = 1videos, count = get_60_videos(ucid, page, auto_generated)+ videos.select! { |video| !video.paid }host_url = make_host_url(Kemal.config.ssl || CONFIG.https_only, env.request.headers["Host"]?)path = env.request.path@@ -2173,6 +2174,7 @@ get "/channel/:ucid" do |env|endvideos, count = get_60_videos(ucid, page, auto_generated, sort_by)+ videos.select! { |video| !video.paid }templated "channel"enddiff --git a/src/invidious/helpers/helpers.cr b/src/invidious/helpers/helpers.crindex 94250a21..4af924c0 100644--- a/src/invidious/helpers/helpers.cr+++ b/src/invidious/helpers/helpers.cr@@ -317,10 +317,10 @@ def extract_items(nodeset, ucid = nil)premium = falseend- if node.xpath_node(%q(.//span[contains(text(), "Get YouTube Premium")]))- paid = true- else+ if !premium || node.xpath_node(%q(.//span[contains(text(), "Free episode")]))paid = false+ else+ paid = trueenditems << SearchVideo.new(