only disable download widget for dmca video ids

This commit is contained in:
Fijxu 2025-06-12 19:14:25 -04:00
parent 9bc9cc8cab
commit a218dadad6
No known key found for this signature in database
GPG Key ID: 32C1DDF333EDA6A4
3 changed files with 5 additions and 5 deletions

View File

@ -503,5 +503,5 @@
"timeline_parse_error_placeholder_heading": "Unable to parse item", "timeline_parse_error_placeholder_heading": "Unable to parse item",
"timeline_parse_error_placeholder_message": "Invidious encountered an error while trying to parse this item. For more information see below:", "timeline_parse_error_placeholder_message": "Invidious encountered an error while trying to parse this item. For more information see below:",
"timeline_parse_error_show_technical_details": "Show technical details", "timeline_parse_error_show_technical_details": "Show technical details",
"dmca_content": "Sorry, this video cannot be played on this instance due to a DMCA/copyright infringement letter sent to the instance administrator." "dmca_content": "This video cannot be downloaded on this instance due to a DMCA/copyright infringement letter sent to the instance administrator."
} }

View File

@ -23,6 +23,10 @@ module Invidious::Frontend::WatchPage
return "<p id=\"download\">#{translate(locale, "Download is disabled")}</p>" return "<p id=\"download\">#{translate(locale, "Download is disabled")}</p>"
end end
if CONFIG.dmca_content.includes?(video.id)
return "<p id=\"download\">#{translate(locale, "dmca_content")}</p>"
end
url = "/download" url = "/download"
if (CONFIG.invidious_companion.present?) if (CONFIG.invidious_companion.present?)
invidious_companion = CONFIG.invidious_companion.sample invidious_companion = CONFIG.invidious_companion.sample

View File

@ -30,10 +30,6 @@ module Invidious::Routes::Watch
return env.redirect "/" return env.redirect "/"
end 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_-]/, "") plid = env.params.query["list"]?.try &.gsub(/[^a-zA-Z0-9_-]/, "")
continuation = process_continuation(env.params.query, plid, id) continuation = process_continuation(env.params.query, plid, id)