Skip to content

Retry "Video unavailable" downloads without cookies when anonymous extraction succeeds #812

Description

@JT4G

Description

Youtarr can fail to download certain publicly available YouTube videos when cookies are enabled.

yt-dlp reports:

ERROR: [youtube] <video-id>: Video unavailable

However, the exact same video succeeds when yt-dlp is run without cookies.

I have seen this affect multiple videos from the same channel repeatedly over more than a week.

Youtarr currently retries the affected video on subsequent channel scans using cookies again, so it keeps failing with the same error.

Environment

  • Youtarr: v1.81.1
  • yt-dlp: stable@2026.08.19
  • Python: 3.11.2
  • ffmpeg: 5.1.9
  • Docker on Linux
  • Cookies enabled using Youtarr's uploaded cookie file
  • yt-dlp IP family: IPv4

Reproduction

Affected video:

https://www.youtube.com/watch?v=kLibHr-jNeE

Without cookies:

docker exec -it youtarr yt-dlp -vU --simulate \
  "https://www.youtube.com/watch?v=kLibHr-jNeE"

This succeeds:

[youtube] kLibHr-jNeE: Downloading visionos player API JSON
[info] kLibHr-jNeE: Downloading 1 format(s): 401+251-5

With cookies:

docker exec -it youtarr yt-dlp -vU --simulate \
  --cookies /app/config/cookies.user.txt \
  "https://www.youtube.com/watch?v=kLibHr-jNeE"

This fails:

[debug] [youtube] Found YouTube account cookies
[debug] [youtube] kLibHr-jNeE: web_embedded player response playability status: UNPLAYABLE
[debug] [youtube] kLibHr-jNeE: tv_downgraded player response playability status: UNPLAYABLE
ERROR: [youtube] kLibHr-jNeE: Video unavailable

Forcing tv_downgraded with cookies also fails:

--extractor-args "youtube:player_client=tv_downgraded"

visionos cannot be used while cookies are enabled:

WARNING: [youtube] Skipping client "visionos" since it does not support cookies

But adding --no-cookies after the cookie option succeeds:

docker exec -it youtarr yt-dlp -vU --simulate \
  --cookies /app/config/cookies.user.txt \
  --no-cookies \
  "https://www.youtube.com/watch?v=kLibHr-jNeE"

Result:

[youtube] kLibHr-jNeE: Downloading visionos player API JSON
[info] kLibHr-jNeE: Downloading 1 format(s): 401+251-5

Working proof-of-concept

I patched Youtarr locally using its existing auto-retry system.

The logic is:

  1. Normal download runs with cookies.
  2. An individual video fails with Video unavailable.
  3. If cookies are enabled, Youtarr marks that failed video for an anonymous retry.
  4. Only that video is queued again.
  5. The retry adds --no-cookies.
  6. yt-dlp uses the visionos client.
  7. The download succeeds.

This was tested during an actual scheduled Youtarr channel download.

The logs showed:

ERROR: [youtube] kLibHr-jNeE: Video unavailable

Then:

"anonymousRetry":true

Then:

Retrying cookie-specific Video unavailable failure without cookies

The retry yt-dlp arguments contained:

--cookies /app/config/cookies.user.txt
...
--no-cookies
https://www.youtube.com/watch?v=kLibHr-jNeE

Then:

[youtube] kLibHr-jNeE: Downloading visionos player API JSON
[info] kLibHr-jNeE: Downloading 1 format(s): 299+140-5

and the video downloaded successfully.

Proposed behaviour

When:

  • cookies are enabled
  • an individual video fails with Video unavailable
  • the video is not members-only, upcoming, a premiere, terminated, etc.

Youtarr should retry only that failed video once without cookies.

Cookies should not be disabled globally because they are still needed for other videos and YouTube bot checks.

Implementation notes

Youtarr already has most of the required infrastructure through:

  • transient403RetryPlanner.js
  • downloadJobFinalizer.js
  • enqueueAutoRetryJob()
  • doSpecificDownloads()

The working local patch:

  • detects cookie-specific Video unavailable
  • carries an anonymousRetry flag
  • separates normal authenticated retries from anonymous retries
  • appends --no-cookies only to the anonymous retry job
  • keeps normal 403 retries authenticated
  • continues to use the existing retry-attempt limit

Additional affected video

I have also seen repeated Video unavailable failures with:

JWQYT7m6P-M

So this appears to affect multiple videos, not just one.

Expected result

Youtarr should continue using cookies normally, but automatically fall back to an anonymous retry for an individual public video when authenticated extraction incorrectly returns Video unavailable.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions