Skip to content

Commit 154bca4

Browse files
committed
Added Verification Badge to Youtube Comments
1 parent c584e31 commit 154bca4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/invidious/comments.cr

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ def fetch_youtube_comments(id, cursor, format, locale, thin_mode, region, sort_b
144144

145145
content_html = node_comment["contentText"]?.try { |t| parse_content(t) } || ""
146146
author = node_comment["authorText"]?.try &.["simpleText"]? || ""
147-
147+
verified = node_comment["authorCommentBadge"]? != nil
148+
json.field "verified", verified
148149
json.field "author", author
149150
json.field "authorThumbnails" do
150151
json.array do
@@ -328,7 +329,9 @@ def template_youtube_comments(comments, locale, thin_mode, is_replies = false)
328329
end
329330

330331
author_name = HTML.escape(child["author"].as_s)
331-
332+
if child["verified"].as_bool
333+
author_name += "<i class=\"icon ion ion-md-checkmark-circle\"></i>"
334+
end
332335
html << <<-END_HTML
333336
<div class="pure-g" style="width:100%">
334337
<div class="channel-profile pure-u-4-24 pure-u-md-2-24">

0 commit comments

Comments
 (0)