File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -573,26 +573,24 @@ def content_to_comment_html(content)
573573
574574 if run[" navigationEndpoint" ]?
575575 if url = run[" navigationEndpoint" ][" urlEndpoint" ]?.try & .[" url" ].as_s
576- base_url = URI .parse(url)
577576 url = URI .parse(url)
577+ displayed_url = url
578578
579579 if url.host == " youtu.be"
580- url = " youtube.com/watch?v=#{ url.request_target.lstrip('/' ) } "
580+ url = " /watch?v=#{ url.request_target.lstrip('/' ) } "
581+ displayed_url = " youtube.com#{ url } "
581582 elsif url.host.nil? || url.host.not_nil!.ends_with?(" youtube.com" )
582583 if url.path == " /redirect"
583584 # Sometimes, links can be corrupted (why?) so make sure to fallback
584585 # nicely. See https://github.com/iv-org/invidious/issues/2682
585586 url = HTTP ::Params .parse(url.query.not_nil!)[" q" ]? || " "
587+ displayed_url = url
586588 else
587589 url = url.request_target
590+ displayed_url = " youtube.com#{ url } "
588591 end
589592 end
590593
591- if base_url.host.not_nil!.ends_with?(" youtube.com" ) && base_url.path != " /redirect"
592- displayed_url = " youtube.com#{ base_url.request_target } "
593- else
594- displayed_url = url
595- end
596594 text = %( <a href="#{ url } ">#{ reduce_uri(displayed_url) } </a>)
597595 elsif watch_endpoint = run[" navigationEndpoint" ][" watchEndpoint" ]?
598596 length_seconds = watch_endpoint[" startTimeSeconds" ]?
You can’t perform that action at this time.
0 commit comments