Invidious is an alternative front-end to YouTube
Routes: Redirect unknown channel tabs to channel home page
Samantaz Foxebee973b2454
diff --git a/src/invidious/routes/channels.cr b/src/invidious/routes/channels.crindex 5500672f..d744712d 100644--- a/src/invidious/routes/channels.cr+++ b/src/invidious/routes/channels.cr@@ -1,6 +1,12 @@{% skip_file if flag?(:api_only) %}module Invidious::Routes::Channels+ # Redirection for unsupported routes ("tabs")+ def self.redirect_home(env)+ ucid = env.params.url["ucid"]+ return env.redirect "/channel/#{URI.encode_www_form(ucid)}"+ end+def self.home(env)self.videos(env)enddiff --git a/src/invidious/routing.cr b/src/invidious/routing.crindex f6b3aaa6..8c38aaed 100644--- a/src/invidious/routing.cr+++ b/src/invidious/routing.cr@@ -131,7 +131,7 @@ module Invidious::Routing# Channel catch-all, to redirect future routes to the channel's home# NOTE: defined last in order to be processed after the other routes- get "/channel/:ucid/*", Routes::Channels, :home+ get "/channel/:ucid/*", Routes::Channels, :redirect_home# /c/LinusTechTipsget "/c/:user", Routes::Channels, :brand_redirect