Files
invidious/patches/014-rewrite-obnoxious-blocked-message.patch
T
2025-06-18 11:27:18 +02:00

19 lines
1.0 KiB
Diff
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
diff --git a/src/invidious/helpers/errors.cr b/src/invidious/helpers/errors.cr
index b2df682d..7534ef31 100644
--- a/src/invidious/helpers/errors.cr
+++ b/src/invidious/helpers/errors.cr
@@ -84,7 +84,12 @@ def error_template_helper(env : HTTP::Server::Context, status_code : Int32, mess
locale = env.get("preferences").as(Preferences).locale
- error_message = translate(locale, message)
+ if message.includes?("This helps protect our community") || message.includes?("Watch on the latest version of YouTube") || message.includes?("Sign in to confirm youre not a bot") || message.includes?("Please sign in") || message.includes?("This content isn't available, try again later")
+ error_message = "<h2>Error loading video</h2><p style='font-size: 0.8em; margin: -20px 0 20px 0;'>Received error from YouTube: " + message + "<br /><br />Please try reloading the page or try switching to another backend.</p>"
+ else
+ error_message = translate(locale, message)
+ end
+
next_steps = error_redirect_helper(env)
return templated "error"