From a7935bc3782249b82d44e4b85263ffe457874431 Mon Sep 17 00:00:00 2001 From: Fijxu Date: Sat, 6 Dec 2025 17:15:25 -0300 Subject: [PATCH] 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 --- locales/en-US.json | 3 ++- src/invidious/frontend/watch_page.cr | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/locales/en-US.json b/locales/en-US.json index 6fd1ab0b..5b2ef8d0 100644 --- a/locales/en-US.json +++ b/locales/en-US.json @@ -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." } diff --git a/src/invidious/frontend/watch_page.cr b/src/invidious/frontend/watch_page.cr index c0926164..14e169e8 100644 --- a/src/invidious/frontend/watch_page.cr +++ b/src/invidious/frontend/watch_page.cr @@ -23,6 +23,10 @@ module Invidious::Frontend::WatchPage return "

#{translate(locale, "Download is disabled")}

" end + if CONFIG.dmca_content.includes?(video.id) + return "

#{translate(locale, "dmca_content")}

" + end + url = "/download" if (CONFIG.invidious_companion.present?) invidious_companion = CONFIG.invidious_companion.sample