diff --git a/src/invidious/channels.cr b/src/invidious/channels.cr index 9ba3ac96..894f0ffb 100644 --- a/src/invidious/channels.cr +++ b/src/invidious/channels.cr @@ -324,7 +324,7 @@ def fetch_channel(ucid, db, pull_all_videos = true, locale = nil) updated: Time.utc, ucid: video.ucid, author: video.author, - author_verified: video.author_verified, + author_verified: video.author_verified, length_seconds: video.length_seconds, live_now: video.live_now, premiere_timestamp: video.premiere_timestamp, diff --git a/src/invidious/videos.cr b/src/invidious/videos.cr index e6d4c764..196d9736 100644 --- a/src/invidious/videos.cr +++ b/src/invidious/videos.cr @@ -494,6 +494,10 @@ struct Video info["videoDetails"]["author"]?.try &.as_s || "" end + def author_verified + return info["authorVerified"] + end + def length_seconds : Int32 info["microformat"]?.try &.["playerMicroformatRenderer"]?.try &.["lengthSeconds"]?.try &.as_s.to_i || info["videoDetails"]["lengthSeconds"]?.try &.as_s.to_i || 0 @@ -906,6 +910,10 @@ def extract_polymer_config(body) author_info = primary_results.try &.as_a.select { |object| object["videoSecondaryInfoRenderer"]? }[0]? .try &.["videoSecondaryInfoRenderer"]?.try &.["owner"]?.try &.["videoOwnerRenderer"]? + params["authorVerified"] = JSON::Any.new(author_info.try &.["badges"]? + .try &.[0]["metadataBadgeRenderer"]?.try &.["style"]? + .try &.to_s == "BADGE_STYLE_TYPE_VERIFIED" ? true : false || false) + params["authorThumbnail"] = JSON::Any.new(author_info.try &.["thumbnail"]? .try &.["thumbnails"]?.try &.as_a[0]?.try &.["url"]? .try &.as_s || "") diff --git a/src/invidious/views/watch.ecr b/src/invidious/views/watch.ecr index a86e23b2..7b781835 100644 --- a/src/invidious/views/watch.ecr +++ b/src/invidious/views/watch.ecr @@ -206,7 +206,7 @@
-
+
<% if !video.author_thumbnail.empty? %> <% end %> @@ -214,6 +214,10 @@
+ <% if video.author_verified %> + + <% end %> + <% ucid = video.ucid %> <% author = video.author %> <% sub_count_text = video.sub_count_text %>