@@ -102,7 +102,11 @@ private module Parsers
102102 premium = false
103103
104104 premiere_timestamp = item_contents.dig?(" upcomingEventData" , " startTime" ).try { |t | Time .unix(t.as_s.to_i64) }
105+ author_verified_badge = item_contents[" ownerBadges" ]?.try do |badges_array |
106+ badges_array.as_a.find(& .dig(" metadataBadgeRenderer" , " tooltip" ).as_s.== " Verified" )
107+ end
105108
109+ author_verified = (author_verified_badge && author_verified_badge.size > 0 )
106110 item_contents[" badges" ]?.try & .as_a.each do |badge |
107111 b = badge[" metadataBadgeRenderer" ]
108112 case b[" label" ].as_s
@@ -129,6 +133,7 @@ private module Parsers
129133 live_now: live_now,
130134 premium: premium,
131135 premiere_timestamp: premiere_timestamp,
136+ author_verified: author_verified || false ,
132137 })
133138 end
134139
@@ -156,7 +161,11 @@ private module Parsers
156161 private def self.parse (item_contents , author_fallback )
157162 author = extract_text(item_contents[" title" ]) || author_fallback.name
158163 author_id = item_contents[" channelId" ]?.try & .as_s || author_fallback.id
164+ author_verified_badge = item_contents[" ownerBadges" ]?.try do |badges_array |
165+ badges_array.as_a.find(& .dig(" metadataBadgeRenderer" , " tooltip" ).as_s.== " Verified" )
166+ end
159167
168+ author_verified = (author_verified_badge && author_verified_badge.size > 0 )
160169 author_thumbnail = HelperExtractors .get_thumbnails(item_contents)
161170 # When public subscriber count is disabled, the subscriberCountText isn't sent by InnerTube.
162171 # Always simpleText
@@ -179,6 +188,7 @@ private module Parsers
179188 video_count: video_count,
180189 description_html: description_html,
181190 auto_generated: auto_generated,
191+ author_verified: author_verified || false ,
182192 })
183193 end
184194
@@ -206,18 +216,23 @@ private module Parsers
206216 private def self.parse (item_contents , author_fallback )
207217 title = extract_text(item_contents[" title" ]) || " "
208218 plid = item_contents[" playlistId" ]?.try & .as_s || " "
219+ author_verified_badge = item_contents[" ownerBadges" ]?.try do |badges_array |
220+ badges_array.as_a.find(& .dig(" metadataBadgeRenderer" , " tooltip" ).as_s.== " Verified" )
221+ end
209222
223+ author_verified = (author_verified_badge && author_verified_badge.size > 0 )
210224 video_count = HelperExtractors .get_video_count(item_contents)
211225 playlist_thumbnail = HelperExtractors .get_thumbnails(item_contents)
212226
213227 SearchPlaylist .new({
214- title: title,
215- id: plid,
216- author: author_fallback.name,
217- ucid: author_fallback.id,
218- video_count: video_count,
219- videos: [] of SearchPlaylistVideo ,
220- thumbnail: playlist_thumbnail,
228+ title: title,
229+ id: plid,
230+ author: author_fallback.name,
231+ ucid: author_fallback.id,
232+ video_count: video_count,
233+ videos: [] of SearchPlaylistVideo ,
234+ thumbnail: playlist_thumbnail,
235+ author_verified: author_verified || false ,
221236 })
222237 end
223238
@@ -251,7 +266,11 @@ private module Parsers
251266 author_info = item_contents.dig?(" shortBylineText" , " runs" , 0 )
252267 author = author_info.try & .[" text" ].as_s || author_fallback.name
253268 author_id = author_info.try { |x | HelperExtractors .get_browse_id(x) } || author_fallback.id
269+ author_verified_badge = item_contents[" ownerBadges" ]?.try do |badges_array |
270+ badges_array.as_a.find(& .dig(" metadataBadgeRenderer" , " tooltip" ).as_s.== " Verified" )
271+ end
254272
273+ author_verified = (author_verified_badge && author_verified_badge.size > 0 )
255274 videos = item_contents[" videos" ]?.try & .as_a.map do |v |
256275 v = v[" childVideoRenderer" ]
257276 v_title = v.dig?(" title" , " simpleText" ).try & .as_s || " "
@@ -267,13 +286,14 @@ private module Parsers
267286 # TODO: item_contents["publishedTimeText"]?
268287
269288 SearchPlaylist .new({
270- title: title,
271- id: plid,
272- author: author,
273- ucid: author_id,
274- video_count: video_count,
275- videos: videos,
276- thumbnail: playlist_thumbnail,
289+ title: title,
290+ id: plid,
291+ author: author,
292+ ucid: author_id,
293+ video_count: video_count,
294+ videos: videos,
295+ thumbnail: playlist_thumbnail,
296+ author_verified: author_verified || false ,
277297 })
278298 end
279299
0 commit comments