Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion config/config.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/invidious/helpers/handlers.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down
12 changes: 1 addition & 11 deletions src/invidious/routes/api/v1/videos.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading