fix: restore dmca_content functionality

This restores (or adds) the functionality of the `dmca_content` config
option that at this date, has been unused and makes no effect.
This commit is contained in:
Fijxu 2025-03-31 22:47:10 -03:00
parent 23ff6135bb
commit ab862e0d50
No known key found for this signature in database
GPG Key ID: 32C1DDF333EDA6A4
2 changed files with 6 additions and 1 deletions

View File

@ -501,5 +501,6 @@
"toggle_theme": "Toggle Theme",
"carousel_slide": "Slide {{current}} of {{total}}",
"carousel_skip": "Skip the Carousel",
"carousel_go_to": "Go to slide `x`"
"carousel_go_to": "Go to slide `x`",
"dmca_content": "Sorry, this video cannot be played on this instance due to a DMCA/copyright infringement letter sent to the instance administrator."
}

View File

@ -30,6 +30,10 @@ module Invidious::Routes::Watch
return env.redirect "/"
end
if CONFIG.dmca_content.includes?(id)
return error_template(403, "dmca_content")
end
plid = env.params.query["list"]?.try &.gsub(/[^a-zA-Z0-9_-]/, "")
continuation = process_continuation(env.params.query, plid, id)