From 54f9941c7b40706510c664f8bc2ef876eda866db Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Tue, 18 Sep 2018 10:47:22 -0500 Subject: [PATCH] Add alias '/api/v1/channels/videos/:ucid' --- src/invidious.cr | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/invidious.cr b/src/invidious.cr index bd52b76a..fdefa029 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -2634,7 +2634,8 @@ get "/api/v1/channels/:ucid" do |env| channel_info end -get "/api/v1/channels/:ucid/videos" do |env| +["/api/v1/channels/:ucid/videos", "/api/v1/channels/videos/:ucid"].each do |route| + get route do |env| ucid = env.params.url["ucid"] page = env.params.query["page"]?.try &.to_i? page ||= 1 @@ -2731,6 +2732,7 @@ get "/api/v1/channels/:ucid/videos" do |env| env.response.content_type = "application/json" result end +end get "/api/v1/search" do |env| query = env.params.query["q"]?