From 8d08cfe30f550431015a7ecc8845b9c2968e27be Mon Sep 17 00:00:00 2001 From: DUO Labs Date: Thu, 5 Jan 2023 20:42:11 -0500 Subject: [PATCH] Add comments to src/invidious/yt_backend/extractors.cr Co-authored-by: Samantaz Fox --- src/invidious/yt_backend/extractors.cr | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/invidious/yt_backend/extractors.cr b/src/invidious/yt_backend/extractors.cr index 326d2d62..cd52c73b 100644 --- a/src/invidious/yt_backend/extractors.cr +++ b/src/invidious/yt_backend/extractors.cr @@ -171,6 +171,11 @@ private module Parsers # TODO change default value to nil subscriber_count = item_contents.dig?("subscriberCountText", "simpleText") + + # Since youtube added channel handles, `VideoCountText` holds the number of + # subscribers and `subscriberCountText` holds the handle, except when the + # channel doesn't have a handle (e.g: some topic music channels). + # See https://github.com/iv-org/invidious/issues/3394#issuecomment-1321261688 if !subscriber_count || !subscriber_count.as_s.includes? " subscriber" subscriber_count = item_contents.dig?("videoCountText", "simpleText") end