summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2019-04-11 13:52:09 -0500
committerOmar Roth <omarroth@hotmail.com>2019-04-11 13:52:09 -0500
commitaa8ff7ace3602febb4ac4ffb922d18f27628730e (patch)
tree9584d4bd780636410e3e42aa039558945f61bcd6 /src
parent4e6a931de39526dc90b1a3143b4cbec5751fa14d (diff)
downloadinvidious-aa8ff7ace3602febb4ac4ffb922d18f27628730e.tar.gz
invidious-aa8ff7ace3602febb4ac4ffb922d18f27628730e.tar.bz2
invidious-aa8ff7ace3602febb4ac4ffb922d18f27628730e.zip
Always use ucid for channel search
Diffstat (limited to 'src')
-rw-r--r--src/invidious.cr6
-rw-r--r--src/invidious/search.cr4
2 files changed, 3 insertions, 7 deletions
diff --git a/src/invidious.cr b/src/invidious.cr
index cb095099..6ecc0559 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -2521,11 +2521,7 @@ get "/channel/:ucid" do |env|
end
if !auto_generated
- if author.includes?(" ") || author.includes?("-")
- env.set "search", "channel:#{ucid} "
- else
- env.set "search", "channel:#{author.downcase} "
- end
+ env.set "search", "channel:#{ucid} "
end
if auto_generated
diff --git a/src/invidious/search.cr b/src/invidious/search.cr
index 9c985552..c3c48af3 100644
--- a/src/invidious/search.cr
+++ b/src/invidious/search.cr
@@ -53,12 +53,12 @@ alias SearchItem = SearchVideo | SearchChannel | SearchPlaylist
def channel_search(query, page, channel)
client = make_client(YT_URL)
- response = client.get("/user/#{channel}?disable_polymer=1&hl=en&gl=US")
+ response = client.get("/channel/#{channel}?disable_polymer=1&hl=en&gl=US")
document = XML.parse_html(response.body)
canonical = document.xpath_node(%q(//link[@rel="canonical"]))
if !canonical
- response = client.get("/channel/#{channel}?disable_polymer=1&hl=en&gl=US")
+ response = client.get("/c/#{channel}?disable_polymer=1&hl=en&gl=US")
document = XML.parse_html(response.body)
canonical = document.xpath_node(%q(//link[@rel="canonical"]))
end