diff --git a/src/invidious.cr b/src/invidious.cr index 88b9ad85..fb148fcd 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -1302,6 +1302,7 @@ get "/feed/channel/:ucid" do |env| title: title, id: video_id, author: author, + author_verified: false, ucid: ucid, published: published, views: views, diff --git a/src/invidious/helpers/helpers.cr b/src/invidious/helpers/helpers.cr index f6b6acd1..f1cdedc5 100644 --- a/src/invidious/helpers/helpers.cr +++ b/src/invidious/helpers/helpers.cr @@ -265,6 +265,7 @@ def extract_item(item : JSON::Any, author_fallback : String? = nil, author_id_fa live_now = false paid = false premium = false + author_verified = false premiere_timestamp = i["upcomingEventData"]?.try &.["startTime"]?.try { |t| Time.unix(t.as_s.to_i64) } @@ -284,10 +285,21 @@ def extract_item(item : JSON::Any, author_fallback : String? = nil, author_id_fa end end + # Author Badges + i["ownerBadges"]?.try &.as_a.each do |badge| + b = badge["metadataBadgeRenderer"] + case b["style"].as_s + when "BADGE_STYLE_TYPE_VERIFIED" + author_verified = true + else nil + end + end + SearchVideo.new({ title: title, id: video_id, author: author, + author_verified: author_verified, ucid: author_id, published: published, views: view_count, diff --git a/src/invidious/search.cr b/src/invidious/search.cr index 4b216613..16ec6883 100644 --- a/src/invidious/search.cr +++ b/src/invidious/search.cr @@ -4,6 +4,7 @@ struct SearchVideo property title : String property id : String property author : String + property author_verified : Bool property ucid : String property published : Time property views : Int64