diff --git a/src/renderer/views/Watch/Watch.js b/src/renderer/views/Watch/Watch.js index 944886d5e4256..71f0c454c2ca2 100644 --- a/src/renderer/views/Watch/Watch.js +++ b/src/renderer/views/Watch/Watch.js @@ -358,12 +358,21 @@ export default defineComponent({ const playabilityStatus = result.playability_status - if (playabilityStatus.status === 'UNPLAYABLE') { - /** - * @type {import ('youtubei.js').YTNodes.PlayerErrorMessage} - */ - const errorScreen = playabilityStatus.error_screen - throw new Error(`[${playabilityStatus.status}] ${errorScreen.reason.text}: ${errorScreen.subreason.text}`) + // The apostrophe is intentionally that one (char code 8217), because that is the one YouTube uses + const BOT_MESSAGE = 'Sign in to confirm you’re not a bot' + + if (playabilityStatus.status === 'UNPLAYABLE' || (playabilityStatus.status === 'LOGIN_REQUIRED' && playabilityStatus.reason === BOT_MESSAGE)) { + if (playabilityStatus.reason === BOT_MESSAGE) { + throw new Error(this.$t('Video.IP block')) + } + + let errorText = `[${playabilityStatus.status}] ${playabilityStatus.reason}` + + if (playabilityStatus.error_screen) { + errorText += `: ${playabilityStatus.error_screen.subreason.text}` + } + + throw new Error(errorText) } // extract localised title first and fall back to the not localised one diff --git a/static/locales/en-US.yaml b/static/locales/en-US.yaml index 143515e178c8e..0f24dc50d9ac3 100644 --- a/static/locales/en-US.yaml +++ b/static/locales/en-US.yaml @@ -766,6 +766,7 @@ Channel: Video hidden by FreeTube: Video hidden by FreeTube Viewing Posts Only Supported By Invidious: Viewing Posts is only supported by Invidious. Head to a channel's community tab to view content there without Invidious. Video: + IP block: 'YouTube has blocked your IP address from watching videos. Please try switching to a different VPN or proxy.' More Options: More Options Mark As Watched: Mark As Watched Remove From History: Remove From History