Propagate replacing yout.be links to /watch to RSS

このコミットが含まれているのは:
syeopite 2021-09-03 03:33:49 -07:00
コミット a28945273d
この署名に対応する既知のキーがデータベースに存在しません
GPGキーID: 6FA616E5A5294A82
1個のファイルの変更8行の追加4行の削除

ファイルの表示

@ -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