diff --git a/src/invidious/comments.cr b/src/invidious/comments.cr
index f4398b58..5f7b34c0 100644
--- a/src/invidious/comments.cr
+++ b/src/invidious/comments.cr
@@ -491,8 +491,7 @@ def content_to_comment_html(content)
end
if run["navigationEndpoint"]?
- url = run["navigationEndpoint"]["urlEndpoint"]?.try &.["url"].as_s
- if url
+ if url = run["navigationEndpoint"]["urlEndpoint"]?.try &.["url"].as_s
url = URI.parse(url)
if !url.host || {"m.youtube.com", "www.youtube.com", "youtu.be"}.includes? url.host
@@ -502,11 +501,16 @@ def content_to_comment_html(content)
url = url.full_path
end
end
- else
- url = run["navigationEndpoint"]["commandMetadata"]?.try &.["webCommandMetadata"]["url"].as_s
- end
- text = %(#{text})
+ text = %(#{text})
+ elsif watch_endpoint = run["navigationEndpoint"]["watchEndpoint"]?
+ length_seconds = watch_endpoint["startTimeSeconds"].as_i
+ video_id = watch_endpoint["videoId"].as_s
+
+ text = %(#{text})
+ elsif url = run["navigationEndpoint"]["commandMetadata"]?.try &.["webCommandMetadata"]["url"].as_s
+ text = %(#{text})
+ end
end
text