From 7fd4c76a5985ad77527873920569d9231b564512 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Wed, 28 Nov 2018 10:20:52 -0600 Subject: [PATCH] Try to pull UCID instead of brand name in search results --- src/invidious/helpers/helpers.cr | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/invidious/helpers/helpers.cr b/src/invidious/helpers/helpers.cr index 51c5cbf9..8aebe669 100644 --- a/src/invidious/helpers/helpers.cr +++ b/src/invidious/helpers/helpers.cr @@ -249,7 +249,9 @@ def extract_items(nodeset, ucid = nil) ) when .includes? "yt-lockup-channel" author = title.strip - ucid = id.split("/")[-1] + + ucid = node.xpath_node(%q(.//button[contains(@class, "yt-uix-subscription-button")])).try &.["data-channel-external-id"]? + ucid ||= id.split("/")[-1] author_thumbnail = node.xpath_node(%q(.//div/span/img)).try &.["data-thumb"]? author_thumbnail ||= node.xpath_node(%q(.//div/span/img)).try &.["src"]