Links: yt-dlp's "No video formats found" reads as a sign-in/cookies hint
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
197fe113a1
commit
50b2b000a4
2 files changed
+6
No files matched your search
@@ -78,6 +78,9 @@ const noRelayFormatText = "This page has no video a relay can read. Choose 'Ever
|
|||||||
|
|
||||||
/// The plain-words texts of [playErrorText].
|
/// The plain-words texts of [playErrorText].
|
||||||
const needsCookiesText = 'This site needs cookies — Settings → Player → yt-dlp → Cookies';
|
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 notAllowedText = 'Not allowed (403)';
|
||||||
const notFoundText = 'Not found (404)';
|
const notFoundText = 'Not found (404)';
|
||||||
const unsupportedUrlText = 'Not a video page yt-dlp knows';
|
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.
|
// First: its message quotes the URL, which may say anything.
|
||||||
if (s.toLowerCase().contains('unsupported url')) return unsupportedUrlText;
|
if (s.toLowerCase().contains('unsupported url')) return unsupportedUrlText;
|
||||||
if (_cookiesHint.hasMatch(s)) return needsCookiesText;
|
if (_cookiesHint.hasMatch(s)) return needsCookiesText;
|
||||||
|
if (s.toLowerCase().contains('no video formats found')) return noFormatsText;
|
||||||
if (_forbidden.hasMatch(s)) return notAllowedText;
|
if (_forbidden.hasMatch(s)) return notAllowedText;
|
||||||
if (_notFound.hasMatch(s)) return notFoundText;
|
if (_notFound.hasMatch(s)) return notFoundText;
|
||||||
if (_unreachable.hasMatch(s)) return unreachableText;
|
if (_unreachable.hasMatch(s)) return unreachableText;
|
||||||
|
|||||||
@@ -119,6 +119,8 @@ void main() {
|
|||||||
expect(playErrorText('[BiliBili] BV1x: Unable to download webpage: HTTP Error 412: Precondition Failed'),
|
expect(playErrorText('[BiliBili] BV1x: Unable to download webpage: HTTP Error 412: Precondition Failed'),
|
||||||
needsCookiesText);
|
needsCookiesText);
|
||||||
expect(playErrorText('Sign in to confirm your age'), 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('the video server answered HTTP error 403 Forbidden'), notAllowedText);
|
||||||
expect(playErrorText('HTTP Error 404: Not Found'), notFoundText);
|
expect(playErrorText('HTTP Error 404: Not Found'), notFoundText);
|
||||||
expect(playErrorText('Unsupported URL: https://example.com/login/403'), unsupportedUrlText);
|
expect(playErrorText('Unsupported URL: https://example.com/login/403'), unsupportedUrlText);
|
||||||
|
|||||||
Reference in new issue
Block a user