mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-08-14.git
synced 2024-08-15 00:53:20 +00:00
Filter paid videos from RSS and channel list
This commit is contained in:
parent
c2c224b16f
commit
0832fa9bdb
2 changed files with 5 additions and 3 deletions
|
@ -1909,6 +1909,7 @@ get "/feed/channel/:ucid" do |env|
|
||||||
|
|
||||||
page = 1
|
page = 1
|
||||||
videos, count = get_60_videos(ucid, page, auto_generated)
|
videos, 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"]?)
|
host_url = make_host_url(Kemal.config.ssl || CONFIG.https_only, env.request.headers["Host"]?)
|
||||||
path = env.request.path
|
path = env.request.path
|
||||||
|
@ -2173,6 +2174,7 @@ get "/channel/:ucid" do |env|
|
||||||
end
|
end
|
||||||
|
|
||||||
videos, count = get_60_videos(ucid, page, auto_generated, sort_by)
|
videos, count = get_60_videos(ucid, page, auto_generated, sort_by)
|
||||||
|
videos.select! { |video| !video.paid }
|
||||||
|
|
||||||
templated "channel"
|
templated "channel"
|
||||||
end
|
end
|
||||||
|
|
|
@ -317,10 +317,10 @@ def extract_items(nodeset, ucid = nil)
|
||||||
premium = false
|
premium = false
|
||||||
end
|
end
|
||||||
|
|
||||||
if node.xpath_node(%q(.//span[contains(text(), "Get YouTube Premium")]))
|
if !premium || node.xpath_node(%q(.//span[contains(text(), "Free episode")]))
|
||||||
paid = true
|
|
||||||
else
|
|
||||||
paid = false
|
paid = false
|
||||||
|
else
|
||||||
|
paid = true
|
||||||
end
|
end
|
||||||
|
|
||||||
items << SearchVideo.new(
|
items << SearchVideo.new(
|
||||||
|
|
Loading…
Reference in a new issue