Merge pull request #1714 from tenpura-shrimp/searchchannelthumbnailhttps

Remove HTTPS from channel thumbnail in search
This commit is contained in:
TheFrenchGhosty 2021-01-29 22:54:27 +00:00 committed by GitHub
commit 69406b00d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -225,7 +225,7 @@ def extract_item(item : JSON::Any, author_fallback : String? = nil, author_id_fa
author = i["title"]["simpleText"]?.try &.as_s || author_fallback || ""
author_id = i["channelId"]?.try &.as_s || author_id_fallback || ""
author_thumbnail = i["thumbnail"]["thumbnails"]?.try &.as_a[0]?.try { |u| "https:#{u["url"]}" } || ""
author_thumbnail = i["thumbnail"]["thumbnails"]?.try &.as_a[0]?.try &.["url"]?.try &.as_s || ""
subscriber_count = i["subscriberCountText"]?.try &.["simpleText"]?.try &.as_s.try { |s| short_text_to_number(s.split(" ")[0]) } || 0
auto_generated = false