Add new error messages

This commit is contained in:
Sommerwiesel
2025-06-18 11:56:03 +02:00
parent 2772348284
commit 5b1c1de323
@@ -7,8 +7,8 @@ index b2df682d..7534ef31 100644
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 you’re 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>"
+ if message.includes?("Error while communicating with Invidious companion") || message.includes?("YouTube is currently trying to block Invidious instances") || message.includes?("This helps protect our community") || message.includes?("Watch on the latest version of YouTube") || message.includes?("Sign in to confirm you’re 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;'>Original error message: " + message + "<br /><br /><b>Please try reloading the page or try switching to another backend. This will fix it almost all the time.</b></p>"
+ else
+ error_message = translate(locale, message)
+ end