summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2018-11-28 10:20:52 -0600
committerOmar Roth <omarroth@hotmail.com>2018-11-28 10:20:52 -0600
commit7fd4c76a5985ad77527873920569d9231b564512 (patch)
tree36a21d167782994b75967190a0a67c1ae53431cd /src
parent4480e9c1bae261f41b132df1fb1a61695c488486 (diff)
downloadinvidious-7fd4c76a5985ad77527873920569d9231b564512.tar.gz
invidious-7fd4c76a5985ad77527873920569d9231b564512.tar.bz2
invidious-7fd4c76a5985ad77527873920569d9231b564512.zip
Try to pull UCID instead of brand name in search results
Diffstat (limited to 'src')
-rw-r--r--src/invidious/helpers/helpers.cr4
1 files changed, 3 insertions, 1 deletions
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"]