mirror of
https://github.com/iv-org/invidious.git
synced 2025-07-09 16:19:32 -04:00
Handle url.host correctly
This commit is contained in:
parent
a97e2cbe27
commit
2e6e1e6623
1 changed files with 2 additions and 3 deletions
|
@ -552,10 +552,9 @@ def content_to_comment_html(content)
|
|||
if url = run["navigationEndpoint"]["urlEndpoint"]?.try &.["url"].as_s
|
||||
url = URI.parse(url)
|
||||
|
||||
if !url.host
|
||||
elsif url.host == "youtu.be"
|
||||
if url.host == "youtu.be"
|
||||
url = "/watch?v=#{url.request_target.lstrip('/')}"
|
||||
elsif {"m.youtube.com", "www.youtube.com"}.includes? url
|
||||
elsif !url.host || {"m.youtube.com", "www.youtube.com"}.includes? url
|
||||
if url.path == "/redirect"
|
||||
url = HTTP::Params.parse(url.query.not_nil!)["q"]
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue