diff --git a/packages/core/lib/src/link_probe.dart b/packages/core/lib/src/link_probe.dart index 2e6616e..6d4c3d6 100644 --- a/packages/core/lib/src/link_probe.dart +++ b/packages/core/lib/src/link_probe.dart @@ -78,6 +78,9 @@ const noRelayFormatText = "This page has no video a relay can read. Choose 'Ever /// The plain-words texts of [playErrorText]. const needsCookiesText = 'This site needs cookies — Settings → Player → yt-dlp → Cookies'; +/// yt-dlp read the page but got no video, typically a site that hides it +/// from signed-out visitors (Bilibili does for some videos). +const noFormatsText = 'No video found: it may need signing in (cookies: Settings → Player → yt-dlp)'; const notAllowedText = 'Not allowed (403)'; const notFoundText = 'Not found (404)'; const unsupportedUrlText = 'Not a video page yt-dlp knows'; @@ -100,6 +103,7 @@ String playErrorText(String raw) { // First: its message quotes the URL, which may say anything. if (s.toLowerCase().contains('unsupported url')) return unsupportedUrlText; if (_cookiesHint.hasMatch(s)) return needsCookiesText; + if (s.toLowerCase().contains('no video formats found')) return noFormatsText; if (_forbidden.hasMatch(s)) return notAllowedText; if (_notFound.hasMatch(s)) return notFoundText; if (_unreachable.hasMatch(s)) return unreachableText; diff --git a/packages/core/test/yt_dlp_test.dart b/packages/core/test/yt_dlp_test.dart index 825658d..07c90e4 100644 --- a/packages/core/test/yt_dlp_test.dart +++ b/packages/core/test/yt_dlp_test.dart @@ -119,6 +119,8 @@ void main() { expect(playErrorText('[BiliBili] BV1x: Unable to download webpage: HTTP Error 412: Precondition Failed'), needsCookiesText); expect(playErrorText('Sign in to confirm your age'), needsCookiesText); + expect(playErrorText('ERROR: [BiliBili] 1Zzpp6WEda: No video formats found!; please report this issue on https://github.com/yt-dlp/yt-dlp/issues'), + noFormatsText); expect(playErrorText('the video server answered HTTP error 403 Forbidden'), notAllowedText); expect(playErrorText('HTTP Error 404: Not Found'), notFoundText); expect(playErrorText('Unsupported URL: https://example.com/login/403'), unsupportedUrlText);