Skip to content
EN
Get API key
Browse documentation

Guides

Fix yt-dlp’s “Sign in to confirm you’re not a bot” error

Resolve “Sign in to confirm you’re not a bot” with nightly, Deno, a valid session and a working exit IP.

On this page

Start with these four checks

  1. Update nightly. Upgrade the failing worker, then retest one source.
  2. Check Deno. Confirm the runtime appears in the verbose log.
  3. Try a valid session. Browser cookies can help with a small download job.
  4. Test another exit IP. If the same public source works there, move jobs off the flagged route.

Different message? Choose the right fix

Message or behaviorWhere to go next
Sign in to confirm you’re not a bot / LOGIN_REQUIREDVerify nightly and Deno, then compare exit IPs and a valid session.
The provided YouTube account cookies are no longer validReplace the exported session using the renewal procedure below.
HTTP 429Pause the affected exit and lower request frequency; use the separate 429 guide.
Could not copy Chrome cookie database / Failed to decrypt with DPAPIFix the local cookie-loading failure; the intended authenticated request has not happened yet.
Formats selected, then media HTTP 403Follow the 403 guide for concurrency, IP and media-request context.

1. Update and test one source

Refresh the baseline before testing access
python -m pip install -U --pre "yt-dlp[default,curl-cffi]"
python -m yt_dlp --version
deno --version

Use Deno 2.3+ and confirm its detection in the verbose log; it is required by this workflow. The [default] extra provides the matching EJS solver. For an official standalone binary, use yt-dlp --update-to nightly and replace python -m yt_dlp with yt-dlp. Keep the same source and network for both tests below.

A. Clean anonymous extraction
python -m yt_dlp --ignore-config --js-runtimes deno --impersonate="" --verbose --no-playlist \
  --simulate "https://www.youtube.com/watch?v=jNQXAC9IVRw"
Replace the example with your failing watch URL. --ignore-config removes implicit cookie/client settings; it does not remove environment proxies or installed plugins.
B. The Firefox profile that can play the video
python -m yt_dlp --ignore-config --js-runtimes deno --impersonate="" --verbose --no-playlist \
  --cookies-from-browser firefox --simulate "https://www.youtube.com/watch?v=jNQXAC9IVRw"
Sign into the intended account in Firefox and confirm the exact video plays there first. This reads that browser session; it does not use a session from Chrome.
A / B resultWhat to change
A works; B failsRemove unnecessary cookie options from your public-video job. The selected session or authenticated client path is introducing the failure. Renew it only for work that needs account access.
A fails; B worksKeep that working session source in the job. For a headless worker, export the session with the procedure below and retest on the worker.
B cannot copy/decrypt cookiesResolve the local browser-file error first. You have not tested authenticated access yet.
Both fail on the server; the same test works locallyCheck the worker's runtime/config, then compare its outbound network and total request volume.
Both fail for one source; a public control succeedsCheck the exact source's availability and the account's access. A different public video succeeding does not establish access to this one.

Keep old player_client overrides out of this baseline. The authenticated and anonymous default clients can differ. Supplying cookies is therefore a meaningful change to both session context and client selection, not simply adding a universal unlock flag.

2. Replace a persistently flagged IP

Use this branch when many public videos fail on one worker but the same configuration succeeds elsewhere. Test a fresh source extraction and media download through a different host or proxy exit. Changing the source IP is the practical recovery when that IP is the condition YouTube keeps rejecting.

Try one replacement sticky proxy route
python -m yt_dlp --ignore-config --js-runtimes deno --impersonate="" --verbose --no-playlist \
  --proxy "http://USER:PASSWORD@HOST:PORT" -f ba -o "diagnostics/%(id)s-%(epoch)s.%(ext)s" \
  "https://www.youtube.com/watch?v=jNQXAC9IVRw"
Use a session that keeps one outbound IP for the entire job. Add --cookies only if the access comparison showed they were needed.

Verify the replacement really has a different exit IP. Proxy services can keep the same exit behind a changed gateway or username. For large collections, keep a pool of tested exits, limit concurrency per exit and move new jobs away from a flagged one. Rotate before a new extraction or after a failed job, not between the player request and its media transfer.

ComparisonAction
New exit works; old exit still asks for sign-inKeep the working route and cool down/quarantine the old exit. More retries on the old exit do not renew its reputation.
Cookies work for a few videosUse that session for the small job. Do not scale by sharing it across many busy workers.
Browser works at home; worker still failsThe home IP/session is not the server IP/session. Repeat the same one-video test on the worker's actual route.
A specific video fails on every routeVerify that source's availability and account requirements separately from the public-video control.

A browser cookie workaround is useful for limited downloads, but a large dataset cannot depend on continually finding and refreshing many account sessions. For bulk public-video work, invest in exit-IP quality, rotation and per-IP pacing. Keep cookies for access that needs an account; a proxy does not grant private-video access.

Compare IPv4 on a direct worker route
python -m yt_dlp --ignore-config --js-runtimes deno --impersonate="" --verbose --no-playlist \
  --force-ipv4 -f ba -o "diagnostics/%(id)s-%(epoch)s.%(ext)s" \
  "https://www.youtube.com/watch?v=jNQXAC9IVRw"
When a proxy is configured, -4 may only affect the connection to the proxy. Check the actual outbound route.

3. Use cookies for a small job

A browser's display name is not its profile-directory name. In Chrome, read Profile Path at chrome://version. In Firefox, use about:profiles to identify the profile that actually has the working YouTube session. A background service running as a different OS user will not automatically inherit it.

Use this when the default profile can play the video. If several profiles exist, pass the intended profile's name or path using Firefox's supported browser/profile syntax.

Default Firefox profile
python -m yt_dlp --ignore-config --js-runtimes deno --impersonate="" --verbose --no-playlist \
  --cookies-from-browser firefox -f ba -o "diagnostics/%(id)s-%(epoch)s.%(ext)s" \
  "https://www.youtube.com/watch?v=jNQXAC9IVRw"

The cookie file authenticates a browser session. Keep it out of Git, support attachments and public logs. Test the account's real access in the browser; cookie export cannot add access to a private, removed or membership-restricted video.

4. Renew an expired session

Markers for this branch
The provided YouTube account cookies are no longer valid
playability status: LOGIN_REQUIRED
Shortened markers seen together in upstream issue #15527. The first line alone is not evidence of a valid session.

For a saved cookie file, upstream recommends exporting a dedicated private session and then leaving that session closed. A normal YouTube tab can rotate the session after export. Use this sequence:

  1. Open a new private/incognito window and sign into the account that can access the source.
  2. In that same tab, open https://www.youtube.com/robots.txt. Keep it as the only tab in the private session.
  3. Export youtube.com cookies from that private session using a cookie-export extension linked in the upstream FAQ, with access to private/incognito windows enabled.
  4. Close the entire private window after exporting. Do not keep using that exported session in the browser.
  5. Store the export privately and run the single-source test with --cookies pointing to the new file.

Combining --cookies-from-browser with --cookies exports the ordinary browser profile; it does not capture that private session. Changing the file's expiry columns also does not renew a session that the server has invalidated.

Retest the replacement, without replaying the batch
python -m yt_dlp --ignore-config --js-runtimes deno --impersonate="" --verbose --no-playlist \
  --cookies private/youtube-cookies.txt -f ba -o "diagnostics/%(id)s-%(epoch)s.%(ext)s" \
  "https://www.youtube.com/watch?v=jNQXAC9IVRw"

If the invalid-cookie warning remains, confirm the worker received the newly exported file and that the export came from the intended private session. If the warning disappears but LOGIN_REQUIRED remains, move to the network/source comparison below. If media selection succeeds and the transfer now returns 403, use the GVS-token and transfer checks.

Linux / Docker: copy a read-only cookie secret

--cookies is also an output path: yt-dlp saves its cookie jar when the instance closes. Pointing it directly at a read-only secret can produce a filesystem error, even after a transfer. Multiple workers writing the same exported file can also overwrite each other's state.

Keep the supplied export private and copy it into each job's temporary directory. The following Python example uses Deno for challenges and downloads one audio stream. Replace the cookie-file path with your mounted secret path; no API key is required.

Copy the session before giving it to yt-dlp
from pathlib import Path
from shutil import copyfile
from tempfile import TemporaryDirectory
from yt_dlp import YoutubeDL
from yt_dlp.networking.impersonate import ImpersonateTarget

source_cookie_file = Path("/run/secrets/youtube-cookies.txt")

with TemporaryDirectory(prefix="yt-session-") as temporary:
    job_cookies = Path(temporary) / "cookies.txt"
    copyfile(source_cookie_file, job_cookies)
    options = {
        "cookiefile": str(job_cookies),
        "js_runtimes": {"deno": {}},
        "impersonate": ImpersonateTarget(),
        "noplaylist": True,
        "format": "ba",
        "outtmpl": "downloads/%(id)s.%(ext)s",
    }
    with YoutubeDL(options) as downloader:
        downloader.download(["https://www.youtube.com/watch?v=jNQXAC9IVRw"])
Keep the downloader context inside the temporary-directory context so the cookie file still exists when yt-dlp saves it. This protects the supplied file; it does not renew an expired session.

For a long-running service, distribute a fresh export through your existing secret-management process and start new jobs with it. Do not blindly share one mutable cookie file across concurrent jobs. Keep any session renewal separate from the successful-download archive.

PO-token provider loaded, but still blocked

Inspect whether the provider was merely discovered or actually generated a token. For a GVS token, the extractor normally needs a usable player result first. If that client returns LOGIN_REQUIRED earlier, it may never reach the media-token request.

Log evidenceNext action
PO Token Providers lists bgutil, but the log shows no token generationRead preceding player errors. A loaded plugin is not evidence of successful authentication or token generation.
Error reaching GET … /pingFix the service address. In a worker container, localhost is the worker; use the provider service name on a shared network.
Generating a gvs PO Token followed by LOGIN_REQUIREDVerify the session and the worker route. Reinstalling the same provider does not change the account or outbound network.
Token generated, formats selected, then media 403Check the selected client's token context and extraction/transfer route in the 403 guide.

The provider project documents a datacenter case where a token was generated and the sign-in error persisted. That is why the success check must include the player response and a real media transfer, not only the provider startup line.

Resume with fewer requests

The separate message This content isn't available, try again later is documented upstream as a guest/account request-rate limit. Stop the workers using that session, retain their failed IDs and let the rejection clear before retrying a single source. There is no useful reason to replay the full manifest while every item gets the same response.

Resume using the working configuration and sleep preset
python -m yt_dlp --ignore-config --config-locations yt-dlp-work.conf -t sleep --retries 3 \
  --fragment-retries 3 --batch-file urls.txt
Keep the same archive and output policy. The configuration must contain your working runtime and any required session/provider settings.
ControlWhat changes
-t sleepApplies yt-dlp's pacing preset within this process. Inspect the verbose configuration for the effective sleep values.
--sleep-requestsPauses extraction requests. Relevant to metadata/player requests, including workflows that never download media.
--sleep-intervalWaits before media downloads. It does not pace a separate tight loop of metadata-only requests.
--limit-rateLimits transfer bandwidth; it does not limit player-query frequency.
Queue concurrencyLimits the combined work across your processes. Ten paced workers can still overlap through one session.

Keep the application retry budget separate from yt-dlp's retry settings. Ten job retries, each launching another downloader with its own retries, can multiply the requests. Treat an expired session as a renewal task and a persistently unavailable source as a failed item, rather than immediately requeuing both.

Windows: cookie copying and decryption errors

FailureConcrete actionWhat to check next
Could not copy Chrome cookie database / Permission deniedClose all Chrome windows and its remaining background processes, then rerun as the same OS user. Confirm Profile Path rather than guessing it.The log should advance past database copying. If the next error is decryption, use the next row.
Failed to decrypt with DPAPIUse a Firefox profile with the intended login, or export YouTube cookies to Netscape format and pass --cookies. Windows Chrome encryption is a known upstream issue.Successful cookie loading followed by a player response. Running as administrator or changing video formats does not decrypt the session.
Cookies file must be Netscape formatted, not JSONRe-export as cookies.txt/Netscape format. A browser JSON export or a raw Cookie request header is not that format.The file parser accepts the export; then test whether YouTube accepts the session.
No such file or directoryCheck the path under the actual service user. The worker container cannot read a profile that exists only on your laptop.The expected file is present at the path in the command, without printing its contents.

These failures happen before the intended authenticated request. Replacing your outbound IP cannot make an unreadable database readable. Conversely, once cookies load correctly, a continuing bot-check response needs a session or network test rather than another database-copy workaround.

Check that the original failure is resolved

  • Cookie-load failure: verify copying/parsing/decryption succeeds before interpreting YouTube's response.
  • Invalid session: verify the invalid-cookie warning disappears and the exact source produces a usable player response.
  • Provider failure: verify discovery, service reachability and a token-generation event when required.
  • Download failure: verify the intended video/audio stream actually reaches the output file; simulation alone is not completion.
  • Collection failure: resume one worker with the existing archive and inspect failed items before restoring the normal queue.

Do not use cache deletion, certificate-check disabling or an arbitrary User-Agent as substitutes for these checks. They do not renew a server-rejected session or decrypt a browser database. Keep the exact working change and dependency versions with the worker configuration.