diff --git a/src/invidious/frontend/comments_youtube.cr b/src/invidious/frontend/comments_youtube.cr index 89d3caef..37aca49e 100644 --- a/src/invidious/frontend/comments_youtube.cr +++ b/src/invidious/frontend/comments_youtube.cr @@ -1,6 +1,222 @@ module Invidious::Frontend::Comments extend self + def template_youtube_disabled(locale) + <<-END_HTML +
#{I18n.translate(locale, "Comments are turned off")}
++ + #{author_name} + + #{sponsor_icon} +
#{child["contentHtml"]}
+ END_HTML + + if child["attachment"]? + attachment = child["attachment"] + + case attachment["type"] + when "image" + attachment = attachment["imageThumbnails"][1] + + html << <<-END_HTML +#{attachment["error"]}
+
+ #{I18n.translate(locale, "`x` ago", recode_date(Time.unix(child["published"].as_i64), locale))} #{child["isEdited"] == true ? I18n.translate(locale, "(edited)") : ""}
+ |
+ END_HTML
+
+ if comments["videoId"]?
+ html << <<-END_HTML
+ [YT]
+ |
+ END_HTML
+ elsif comments["authorId"]?
+ html << <<-END_HTML
+ [YT]
+ |
+ END_HTML
+ end
+
+ html << <<-END_HTML
+ #{number_with_separator(child["likeCount"])}
+ END_HTML
+
+ if child["creatorHeart"]?
+ if !thin_mode
+ creator_thumbnail = "/ggpht#{URI.parse(child["creatorHeart"]["creatorThumbnail"].as_s).request_target}"
+ else
+ creator_thumbnail = ""
+ end
+
+ html << <<-END_HTML
+
+
+
+
+
+
+
+
+
+ END_HTML
+ end
+
+ html << <<-END_HTML
+