mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2023-06-08.git
synced 2024-08-15 00:53:38 +00:00
Fix "cast from Nil to Bool failed"
This commit is contained in:
parent
f5fb4c6c64
commit
b84ce6a556
1 changed files with 3 additions and 2 deletions
|
@ -614,7 +614,7 @@ struct Video
|
|||
end
|
||||
|
||||
def author_verified : Bool
|
||||
info["authorVerified"].try &.as_bool || false
|
||||
info["authorVerified"]?.try &.as_bool || false
|
||||
end
|
||||
|
||||
def sub_count_text : String
|
||||
|
@ -1093,7 +1093,8 @@ def extract_video_info(video_id : String, proxy_region : String? = nil, context_
|
|||
author_thumbnail = author_info.try &.dig?("thumbnail", "thumbnails", 0, "url")
|
||||
|
||||
author_verified_badge = author_info.try &.dig?("badges", 0, "metadataBadgeRenderer", "tooltip")
|
||||
params["authorVerified"] = JSON::Any.new((author_verified_badge && author_verified_badge == "Verified"))
|
||||
author_verified = (!author_verified_badge.nil? && author_verified_badge == "Verified")
|
||||
params["authorVerified"] = JSON::Any.new(author_verified)
|
||||
|
||||
params["authorThumbnail"] = JSON::Any.new(author_thumbnail.try &.as_s || "")
|
||||
|
||||
|
|
Loading…
Reference in a new issue