diff options
| author | Omar Roth <omarroth@hotmail.com> | 2018-11-28 10:20:52 -0600 |
|---|---|---|
| committer | Omar Roth <omarroth@hotmail.com> | 2018-11-28 10:20:52 -0600 |
| commit | 7fd4c76a5985ad77527873920569d9231b564512 (patch) | |
| tree | 36a21d167782994b75967190a0a67c1ae53431cd /src | |
| parent | 4480e9c1bae261f41b132df1fb1a61695c488486 (diff) | |
| download | invidious-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.cr | 4 |
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"] |
