diff --git a/src/invidious.cr b/src/invidious.cr index b268492e..dde0274a 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -325,8 +325,9 @@ end Invidious::Routing.get "/channel/:ucid/playlists", Invidious::Routes::Channels, :playlists Invidious::Routing.get "/channel/:ucid/community", Invidious::Routes::Channels, :community Invidious::Routing.get "/channel/:ucid/about", Invidious::Routes::Channels, :about + Invidious::Routing.get "/channel/:ucid/search", Invidious::Routes::Channels, :search - ["", "/videos", "/playlists", "/community", "/about"].each do |path| + ["", "/home", "/videos", "/playlists", "/community", "/channels", "/about", "/search"].each do |path| # /c/LinusTechTips Invidious::Routing.get "/c/:user#{path}", Invidious::Routes::Channels, :brand_redirect # /user/linustechtips | Not always the same as /c/ diff --git a/src/invidious/routes/channels.cr b/src/invidious/routes/channels.cr index be572a22..a797056f 100644 --- a/src/invidious/routes/channels.cr +++ b/src/invidious/routes/channels.cr @@ -157,7 +157,11 @@ module Invidious::Routes::Channels end end - private def self.fetch_basic_information(env) + private def search(env) + return env.redirect "/search?#{env.params.query}&channel=#{env.params.url["ucid"]}" + end + + private def fetch_basic_information(env) locale = LOCALES[env.get("preferences").as(Preferences).locale]? user = env.get? "user"