Skip to content

Invidious is an alternative front-end to YouTube

Extract API routes (#2271)

syeopite4fcd0964cd21
diff --cc src/invidious.cr
index f497a527,1962ae65..27ebd735
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@@ -373,24 -363,10 +373,31 @@@ Invidious::Routing.get "/preferences",
Invidious::Routing.post "/preferences", Invidious::Routes::PreferencesRoute, :update
Invidious::Routing.get "/toggle_theme", Invidious::Routes::PreferencesRoute, :toggle_theme
+# Feeds
+Invidious::Routing.get "/view_all_playlists", Invidious::Routes::Feeds, :view_all_playlists_redirect
+Invidious::Routing.get "/feed/playlists", Invidious::Routes::Feeds, :playlists
+Invidious::Routing.get "/feed/popular", Invidious::Routes::Feeds, :popular
+Invidious::Routing.get "/feed/trending", Invidious::Routes::Feeds, :trending
+Invidious::Routing.get "/feed/subscriptions", Invidious::Routes::Feeds, :subscriptions
+Invidious::Routing.get "/feed/history", Invidious::Routes::Feeds, :history
+
+# RSS Feeds
+Invidious::Routing.get "/feed/channel/:ucid", Invidious::Routes::Feeds, :rss_channel
+Invidious::Routing.get "/feed/private", Invidious::Routes::Feeds, :rss_private
+Invidious::Routing.get "/feed/playlist/:plid", Invidious::Routes::Feeds, :rss_playlist
+Invidious::Routing.get "/feeds/videos.xml", Invidious::Routes::Feeds, :rss_videos
+
+# Support push notifications via PubSubHubbub
+Invidious::Routing.get "/feed/webhook/:token", Invidious::Routes::Feeds, :push_notifications_get
+Invidious::Routing.post "/feed/webhook/:token", Invidious::Routes::Feeds, :push_notifications_post
+
++# API routes (macro)
+ define_v1_api_routes()
++
++# Video playback (macros)
+ define_api_manifest_routes()
+ define_video_playback_routes()
+
# Users
post "/watch_ajax" do |env|