diff --git a/config/config.example.yml b/config/config.example.yml index 85fdd0cd8c..18ef205e30 100644 --- a/config/config.example.yml +++ b/config/config.example.yml @@ -460,7 +460,6 @@ feed_threads: 1 ## ## Notes: The following API endpoints will be disabled: ## - /api/v1/videos -## - /api/v1/clips ## - /api/v1/transcripts ## ## Accepted values: true, false diff --git a/src/invidious/helpers/handlers.cr b/src/invidious/helpers/handlers.cr index 8395c7a4df..ad364b4e2c 100644 --- a/src/invidious/helpers/handlers.cr +++ b/src/invidious/helpers/handlers.cr @@ -136,7 +136,7 @@ end class DisableAbusableAPIHandler < Kemal::Handler {% for method in %w(GET HEAD) %} # This endpoints make a video request to Invidious companion. - {% for endpoint in %w(videos clips transcripts) %} + {% for endpoint in %w(videos transcripts) %} only ["/api/v1/{{ endpoint.id }}/:id"], {{ method }} {% end %} {% end %} diff --git a/src/invidious/routes/api/v1/videos.cr b/src/invidious/routes/api/v1/videos.cr index 0a5d5a4ec1..44268a1c1b 100644 --- a/src/invidious/routes/api/v1/videos.cr +++ b/src/invidious/routes/api/v1/videos.cr @@ -413,22 +413,12 @@ module Invidious::Routes::API::V1::Videos start_time, end_time, clip_title = Invidious::Videos::Clip.parse_clip_parameters(params) end - begin - video = get_video(video_id, region: region) - rescue ex : NotFoundException - return error_json(404, ex) - rescue ex - return error_json(500, ex) - end - return JSON.build do |json| json.object do json.field "startTime", start_time json.field "endTime", end_time json.field "clipTitle", clip_title - json.field "video" do - Invidious::JSONify::APIv1.video(video, json, locale: locale, proxy: proxy) - end + json.field "videoId", video_id end end end