mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2023-06-08.git
synced 2024-08-15 00:53:38 +00:00
Fix #2682
Fix "Missing param name: "q" (KeyError)" https://github.com/iv-org/invidious/issues/2682
This commit is contained in:
parent
c6e086c6ff
commit
342fc202a7
1 changed files with 3 additions and 1 deletions
|
@ -575,7 +575,9 @@ def content_to_comment_html(content)
|
|||
url = "/watch?v=#{url.request_target.lstrip('/')}"
|
||||
elsif url.host.nil? || url.host.not_nil!.ends_with?("youtube.com")
|
||||
if url.path == "/redirect"
|
||||
url = HTTP::Params.parse(url.query.not_nil!)["q"]
|
||||
# Sometimes, links can be corrupted (why?) so make sure to fallback
|
||||
# nicely. See https://github.com/iv-org/invidious/issues/2682
|
||||
url = HTTP::Params.parse(url.query.not_nil!)["q"]? || ""
|
||||
else
|
||||
url = url.request_target
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue