mirror of
https://github.com/iv-org/invidious.git
synced 2024-12-26 02:00:11 +05:30
Propagate replacing yout.be links to /watch to RSS
This commit is contained in:
parent
fd6f03655e
commit
a28945273d
@ -481,11 +481,15 @@ def replace_links(html)
|
||||
url = URI.parse(anchor["href"])
|
||||
|
||||
if {"www.youtube.com", "m.youtube.com", "youtu.be"}.includes?(url.host)
|
||||
if url.path == "/redirect"
|
||||
params = HTTP::Params.parse(url.query.not_nil!)
|
||||
anchor["href"] = params["q"]?
|
||||
if url.host == "youtu.be"
|
||||
url = "/watch?v=#{url.request_target.lstrip('/')}"
|
||||
else
|
||||
anchor["href"] = url.request_target
|
||||
if url.path == "/redirect"
|
||||
params = HTTP::Params.parse(url.query.not_nil!)
|
||||
anchor["href"] = params["q"]?
|
||||
else
|
||||
anchor["href"] = url.request_target
|
||||
end
|
||||
end
|
||||
elsif url.to_s == "#"
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user