From e31053e812517d8d097368ae8863404a4a563731 Mon Sep 17 00:00:00 2001 From: ChunkyProgrammer <78101139+ChunkyProgrammer@users.noreply.github.com> Date: Sun, 19 May 2024 10:46:05 -0400 Subject: [PATCH] Use dig to get properties Co-authored-by: Samantaz Fox --- src/invidious/channels/about.cr | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/invidious/channels/about.cr b/src/invidious/channels/about.cr index b3561fcd2..1380044ac 100644 --- a/src/invidious/channels/about.cr +++ b/src/invidious/channels/about.cr @@ -53,9 +53,9 @@ def get_about_info(ucid, locale) : AboutChannel if ageGate = initdata.dig?("contents", "twoColumnBrowseResultsRenderer", "tabs", 0, "tabRenderer", "content", "sectionListRenderer", "contents", 0, "channelAgeGateRenderer") description_node = nil author = ageGate["channelTitle"].as_s - ucid = initdata["responseContext"]["serviceTrackingParams"][0]["params"][0]["value"].as_s - author_url = "https://www.youtube.com/channel/" + ucid - author_thumbnail = ageGate["avatar"]["thumbnails"][0]["url"].as_s + ucid = initdata.dig("responseContext", "serviceTrackingParams", 0, "params", 0, "value").as_s + author_url = "https://www.youtube.com/channel/#{ucid}" + author_thumbnail = ageGate.dig("avatar", "thumbnails", 0, "url").as_s banner = nil is_family_friendly = false is_age_gated = true