Skip to content

Commit 595c3fb

Browse files
authored
Revert "Youtube verification badge" (#3070)
1 parent 1d25c55 commit 595c3fb

File tree

11 files changed

+26
-77
lines changed

11 files changed

+26
-77
lines changed

src/invidious/channels/about.cr

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ record AboutChannel,
1212
joined : Time,
1313
is_family_friendly : Bool,
1414
allowed_regions : Array(String),
15-
tabs : Array(String),
16-
verified : Bool
15+
tabs : Array(String)
1716

1817
record AboutRelatedChannel,
1918
ucid : String,
@@ -71,9 +70,6 @@ def get_about_info(ucid, locale) : AboutChannel
7170
# if banner.includes? "channels/c4/default_banner"
7271
# banner = nil
7372
# end
74-
# author_verified_badges = initdata["header"]?.try &.["c4TabbedHeaderRenderer"]?.try &.["badges"]?
75-
author_verified_badge = initdata["header"].dig?("c4TabbedHeaderRenderer", "badges", 0, "metadataBadgeRenderer", "tooltip")
76-
author_verified = (author_verified_badge && author_verified_badge == "Verified")
7773

7874
description = initdata["metadata"]["channelMetadataRenderer"]?.try &.["description"]?.try &.as_s? || ""
7975
description_html = HTML.escape(description)
@@ -132,7 +128,6 @@ def get_about_info(ucid, locale) : AboutChannel
132128
is_family_friendly: is_family_friendly,
133129
allowed_regions: allowed_regions,
134130
tabs: tabs,
135-
verified: author_verified || false,
136131
)
137132
end
138133

src/invidious/comments.cr

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,6 @@ def fetch_youtube_comments(id, cursor, format, locale, thin_mode, region, sort_b
146146
content_html = node_comment["contentText"]?.try { |t| parse_content(t) } || ""
147147
author = node_comment["authorText"]?.try &.["simpleText"]? || ""
148148

149-
json.field "verified", (node_comment["authorCommentBadge"]? != nil)
150-
151149
json.field "author", author
152150
json.field "authorThumbnails" do
153151
json.array do
@@ -331,11 +329,7 @@ def template_youtube_comments(comments, locale, thin_mode, is_replies = false)
331329
end
332330

333331
author_name = HTML.escape(child["author"].as_s)
334-
if child["verified"]?.try &.as_bool && child["authorIsChannelOwner"]?.try &.as_bool
335-
author_name += "&nbsp;<i class=\"icon ion ion-md-checkmark-circle\"></i>"
336-
elsif child["verified"]?.try &.as_bool
337-
author_name += "&nbsp;<i class=\"icon ion ion-md-checkmark\"></i>"
338-
end
332+
339333
html << <<-END_HTML
340334
<div class="pure-g" style="width:100%">
341335
<div class="channel-profile pure-u-4-24 pure-u-md-2-24">

src/invidious/helpers/serialized_yt_data.cr

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ struct SearchVideo
1212
property live_now : Bool
1313
property premium : Bool
1414
property premiere_timestamp : Time?
15-
property author_verified : Bool
1615

1716
def to_xml(auto_generated, query_params, xml : XML::Builder)
1817
query_params["v"] = self.id
@@ -130,7 +129,6 @@ struct SearchPlaylist
130129
property video_count : Int32
131130
property videos : Array(SearchPlaylistVideo)
132131
property thumbnail : String?
133-
property author_verified : Bool
134132

135133
def to_json(locale : String?, json : JSON::Builder)
136134
json.object do
@@ -143,8 +141,6 @@ struct SearchPlaylist
143141
json.field "authorId", self.ucid
144142
json.field "authorUrl", "/channel/#{self.ucid}"
145143

146-
json.field "authorVerified", self.author_verified
147-
148144
json.field "videoCount", self.video_count
149145
json.field "videos" do
150146
json.array do
@@ -186,15 +182,14 @@ struct SearchChannel
186182
property video_count : Int32
187183
property description_html : String
188184
property auto_generated : Bool
189-
property author_verified : Bool
190185

191186
def to_json(locale : String?, json : JSON::Builder)
192187
json.object do
193188
json.field "type", "channel"
194189
json.field "author", self.author
195190
json.field "authorId", self.ucid
196191
json.field "authorUrl", "/channel/#{self.ucid}"
197-
json.field "authorVerified", self.author_verified
192+
198193
json.field "authorThumbnails" do
199194
json.array do
200195
qualities = {32, 48, 76, 100, 176, 512}

src/invidious/routes/feeds.cr

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ module Invidious::Routes::Feeds
182182
paid: false,
183183
premium: false,
184184
premiere_timestamp: nil,
185-
author_verified: false, # ¯\_(ツ)_/¯
186185
})
187186
end
188187

src/invidious/videos.cr

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -609,10 +609,6 @@ struct Video
609609
info["authorThumbnail"]?.try &.as_s || ""
610610
end
611611

612-
def author_verified : Bool
613-
info["authorVerified"].try &.as_bool || false
614-
end
615-
616612
def sub_count_text : String
617613
info["subCountText"]?.try &.as_s || "-"
618614
end
@@ -864,12 +860,6 @@ def parse_related_video(related : JSON::Any) : Hash(String, JSON::Any)?
864860
.try &.dig?("runs", 0)
865861

866862
author = channel_info.try &.dig?("text")
867-
author_verified_badge = related["ownerBadges"]?.try do |badges_array|
868-
badges_array.as_a.find(&.dig("metadataBadgeRenderer", "tooltip").as_s.== "Verified")
869-
end
870-
871-
author_verified = (author_verified_badge && author_verified_badge.size > 0).to_s
872-
873863
ucid = channel_info.try { |ci| HelperExtractors.get_browse_id(ci) }
874864

875865
# "4,088,033 views", only available on compact renderer
@@ -893,7 +883,6 @@ def parse_related_video(related : JSON::Any) : Hash(String, JSON::Any)?
893883
"length_seconds" => JSON::Any.new(length || "0"),
894884
"view_count" => JSON::Any.new(view_count || "0"),
895885
"short_view_count" => JSON::Any.new(short_view_count || "0"),
896-
"author_verified" => JSON::Any.new(author_verified),
897886
}
898887
end
899888

@@ -1088,9 +1077,6 @@ def extract_video_info(video_id : String, proxy_region : String? = nil, context_
10881077
author_info = video_secondary_renderer.try &.dig?("owner", "videoOwnerRenderer")
10891078
author_thumbnail = author_info.try &.dig?("thumbnail", "thumbnails", 0, "url")
10901079

1091-
author_verified_badge = author_info.try &.dig?("badges", 0, "metadataBadgeRenderer", "tooltip")
1092-
params["authorVerified"] = JSON::Any.new((author_verified_badge && author_verified_badge == "Verified"))
1093-
10941080
params["authorThumbnail"] = JSON::Any.new(author_thumbnail.try &.as_s || "")
10951081

10961082
params["subCountText"] = JSON::Any.new(author_info.try &.["subscriberCountText"]?

src/invidious/views/channel.ecr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<div class="pure-u-2-3">
2121
<div class="channel-profile">
2222
<img src="/ggpht<%= URI.parse(channel.author_thumbnail).request_target %>">
23-
<span><%= author %></span><% if !channel.verified.nil? && channel.verified %>&nbsp;<i class="icon ion ion-md-checkmark-circle"></i><% end %>
23+
<span><%= author %></span>
2424
</div>
2525
</div>
2626
<div class="pure-u-1-3">

src/invidious/views/community.ecr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<div class="pure-u-2-3">
2020
<div class="channel-profile">
2121
<img src="/ggpht<%= URI.parse(channel.author_thumbnail).request_target %>">
22-
<span><%= author %></span><% if !channel.verified.nil? && channel.verified %>&nbsp;<i class="icon ion ion-md-checkmark-circle"></i><% end %>
22+
<span><%= author %></span>
2323
</div>
2424
</div>
2525
<div class="pure-u-1-3" style="text-align:right">

src/invidious/views/components/item.ecr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<img loading="lazy" style="width:56.25%" src="/ggpht<%= URI.parse(item.author_thumbnail).request_target.gsub(/=s\d+/, "=s176") %>"/>
99
</center>
1010
<% end %>
11-
<p dir="auto"><%= HTML.escape(item.author) %><% if !item.author_verified.nil? && item.author_verified %>&nbsp;<i class="icon ion ion-md-checkmark-circle"></i><% end %></p>
11+
<p dir="auto"><%= HTML.escape(item.author) %></p>
1212
</a>
1313
<p><%= translate_count(locale, "generic_subscribers_count", item.subscriber_count, NumberFormatting::Separator) %></p>
1414
<% if !item.auto_generated %><p><%= translate_count(locale, "generic_videos_count", item.video_count, NumberFormatting::Separator) %></p><% end %>
@@ -30,7 +30,7 @@
3030
<p dir="auto"><%= HTML.escape(item.title) %></p>
3131
</a>
3232
<a href="/channel/<%= item.ucid %>">
33-
<p dir="auto"><b><%= HTML.escape(item.author) %><% if !item.is_a?(InvidiousPlaylist) && !item.author_verified.nil? && item.author_verified %>&nbsp;<i class="icon ion ion-md-checkmark-circle"></i><% end %></b></p>
33+
<p dir="auto"><b><%= HTML.escape(item.author) %></b></p>
3434
</a>
3535
<% when MixVideo %>
3636
<a href="/watch?v=<%= item.id %>&list=<%= item.rdid %>">
@@ -142,7 +142,7 @@
142142

143143
<div class="video-card-row flexible">
144144
<div class="flex-left"><a href="/channel/<%= item.ucid %>">
145-
<p class="channel-name" dir="auto"><%= HTML.escape(item.author) %><% if !item.is_a?(ChannelVideo) && !item.author_verified.nil? && item.author_verified %>&nbsp;<i class="icon ion ion-md-checkmark-circle"></i><% end %></p>
145+
<p class="channel-name" dir="auto"><%= HTML.escape(item.author) %></p>
146146
</a></div>
147147

148148
<% endpoint_params = "?v=#{item.id}" %>

src/invidious/views/playlists.ecr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<div class="pure-u-2-3">
2020
<div class="channel-profile">
2121
<img src="/ggpht<%= URI.parse(channel.author_thumbnail).request_target %>">
22-
<span><%= author %></span><% if !channel.verified.nil? && channel.verified %>&nbsp;<i class="icon ion ion-md-checkmark-circle"></i><% end %>
22+
<span><%= author %></span>
2323
</div>
2424
</div>
2525
<div class="pure-u-1-3" style="text-align:right">

src/invidious/views/watch.ecr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ we're going to need to do it here in order to allow for translations.
207207
<% if !video.author_thumbnail.empty? %>
208208
<img src="/ggpht<%= URI.parse(video.author_thumbnail).request_target %>">
209209
<% end %>
210-
<span id="channel-name"><%= author %><% if !video.author_verified.nil? && video.author_verified %>&nbsp;<i class="icon ion ion-md-checkmark-circle"></i><% end %></span>
210+
<span id="channel-name"><%= author %></span>
211211
</div>
212212
</a>
213213
@@ -281,9 +281,9 @@ we're going to need to do it here in order to allow for translations.
281281
<h5 class="pure-g">
282282
<div class="pure-u-14-24">
283283
<% if rv["ucid"]? %>
284-
<b style="width:100%"><a href="/channel/<%= rv["ucid"] %>"><%= rv["author"]? %><% if rv["author_verified"]? == "true" %>&nbsp;<i class="icon ion ion-md-checkmark-circle"></i><% end %></a></b>
284+
<b style="width:100%"><a href="/channel/<%= rv["ucid"] %>"><%= rv["author"]? %></a></b>
285285
<% else %>
286-
<b style="width:100%"><%= rv["author"]? %><% if rv["author_verified"]? == "true" %>&nbsp;<i class="icon ion ion-md-checkmark-circle"></i><% end %></b>
286+
<b style="width:100%"><%= rv["author"]? %></b>
287287
<% end %>
288288
</div>
289289

0 commit comments

Comments
 (0)