fix: restore dmca_content functionality (#5228)

* 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.

* only disable download widget for dmca video ids
This commit is contained in:
Fijxu
2025-12-06 17:15:25 -03:00
committed by GitHub
parent 07f3894a71
commit a7935bc378
2 changed files with 6 additions and 1 deletions

View File

@@ -505,5 +505,6 @@
"carousel_go_to": "Go to slide `x`",
"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_show_technical_details": "Show technical details"
"timeline_parse_error_show_technical_details": "Show technical details",
"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>"
end
if CONFIG.dmca_content.includes?(video.id)
return "<p id=\"download\">#{translate(locale, "dmca_content")}</p>"
end
url = "/download"
if (CONFIG.invidious_companion.present?)
invidious_companion = CONFIG.invidious_companion.sample