fix: name the error yt-dlp actually raises for a cookie-emptied client set
A review round read yt-dlp's source and found the comment behind the previous commit's safety-net marker did not match it. Measured in the worker with a real account cookie and `player_client=android_vr`: yt-dlp logs `Skipping client "android_vr" since it does not support cookies`, drops it, and the request left with no client fails with "Requested format is not available" — not "No player clients have been requested". That raise sits EARLIER in yt-dlp, before the cookie-capability removal, so the cookie path can never reach it; and an unknown or renamed client is skipped with a warning and replaced by yt-dlp's defaults, so the other scenario the comment named cannot reach it either. So the marker bought nothing: the symptom that does occur was already retriable here before this branch. It is dropped, the comment now states what was measured, and the test asserts the real symptom instead of a message the code cannot produce. The cookie-capability filter itself is vindicated by the same measurement — without it every signed-in download would burn its first attempt on a client yt-dlp discards. Also from the round: an enqueue test for a `source_kind="youtube"` job, the one join nothing else made (a YouTube job stores a bare 11-char ref and the URL the cookie gate keys on is rebuilt by the adapter — both ends were pinned apart, the join was not, and a break there would stop every YouTube cookie silently while signed-out downloads kept working). And copy corrections: the group's only unhedged claim is hedged, "described the video" loses the pipeline vocabulary, and four Hungarian phrasings that read as translated English are rewritten.
This commit is contained in:
@@ -112,9 +112,17 @@ def test_client_sets_and_retriable_are_per_source():
|
||||
assert SourceAdapter().retriable("Sign in to confirm you're not a bot") is False
|
||||
assert YouTubeAdapter().retriable("Sign in to confirm you're not a bot") is True
|
||||
assert YouTubeAdapter().retriable("some unrelated network blip") is False
|
||||
# The empty-set error of a cookie-incapable client list (see _COOKIE_CAPABLE): retriable, so an
|
||||
# admin who configures one still gets the next set tried instead of a hard failure.
|
||||
assert YouTubeAdapter().retriable("ERROR: No player clients have been requested") is True
|
||||
# A client list yt-dlp empties because none of its clients take cookies does NOT raise "No
|
||||
# player clients have been requested" (that raise sits earlier in yt-dlp, before the
|
||||
# cookie-capability removal). Measured with a real cookie: the emptied request fails with
|
||||
# "Requested format is not available", which is retriable here already — so the wasted attempt
|
||||
# is recoverable and `_COOKIE_CAPABLE` exists to avoid spending it at all.
|
||||
assert (
|
||||
YouTubeAdapter().retriable(
|
||||
"ERROR: [youtube] abc: Requested format is not available. Use --list-formats"
|
||||
)
|
||||
is True
|
||||
)
|
||||
# The media fetch refused after a successful extraction: the format URLs belong to the client
|
||||
# that minted them, so the next client set is a real second chance (it used to end the job).
|
||||
assert (
|
||||
|
||||
Reference in New Issue
Block a user