Invidious is an alternative front-end to YouTube
Properly transform youtu.be links to be /watch routes in comments and descriptions (#2365)
syeopitea1001ada479c
diff --git a/src/invidious/comments.cr b/src/invidious/comments.crindex 141a526d..3a4328a5 100644--- a/src/invidious/comments.cr+++ b/src/invidious/comments.cr@@ -552,7 +552,9 @@ def content_to_comment_html(content)if url = run["navigationEndpoint"]["urlEndpoint"]?.try &.["url"].as_surl = URI.parse(url)- if !url.host || {"m.youtube.com", "www.youtube.com", "youtu.be"}.includes? url.host+ if url.host == "youtu.be"+ url = "/watch?v=#{url.request_target.lstrip('/')}"+ elsif !url.host || {"m.youtube.com", "www.youtube.com"}.includes? urlif url.path == "/redirect"url = HTTP::Params.parse(url.query.not_nil!)["q"]else