Channels: Support YouTube's change to from /community to /posts (#5183)

This commit is contained in:
syeopite
2025-02-26 14:13:22 -08:00
5 changed files with 9 additions and 3 deletions

View File

@@ -218,6 +218,8 @@ module Invidious::Routes::Channels
end
def self.community(env)
return env.redirect env.request.path.sub("posts", "community") if env.request.path.split("/").last == "posts"
data = self.fetch_basic_information(env)
if !data.is_a?(Tuple)
return data
@@ -234,7 +236,7 @@ module Invidious::Routes::Channels
continuation = env.params.query["continuation"]?
if !channel.tabs.includes? "community"
if !channel.tabs.includes? "community" && "posts"
return env.redirect "/channel/#{channel.ucid}"
end
@@ -328,6 +330,7 @@ module Invidious::Routes::Channels
private KNOWN_TABS = {
"home", "videos", "shorts", "streams", "podcasts",
"releases", "courses", "playlists", "community", "channels", "about",
"posts",
}
# Redirects brand url channels to a normal /channel/:ucid route