yt-dlp: [youtube] "Video unavailable" with cookies - YouTube blocking accounts from web

DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

  • I understand that I will be blocked if I intentionally remove or skip any mandatory* field

Checklist

Region

No response

Provide a description that is worded well enough to be understood

Recently, YouTube has started blocking accounts that are used a lot with yt-dlp from loading videos through the /player endpoint. Blocked accounts will get “Video unavailable. This content isn’t available.” for all videos.

Blocked accounts can’t load videos in the website, but the Android app works fine (same account and IP were used for the following screenshots)

WEB client Latest stock YouTube client on Android
Website, showing the same error as yt-dlp Android client, loading the same account without issues

Provide verbose output that clearly demonstrates the problem

  • Run your yt-dlp command with -vU flag added (yt-dlp -vU <your command line>)
  • If using API, add 'verbose': True to YoutubeDL params instead
  • Copy the WHOLE output (starting with [debug] Command-line config) and insert it below

Complete Verbose Output

[debug] Command-line config: ['--cookies-from-browser', 'firefox', '-vU', 'dQw4w9WgXcQ']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version nightly@2024.05.30.232720 from yt-dlp/yt-dlp-nightly-builds (linux_exe)
[debug] Python 3.11.9 (CPython x86_64 64bit) - Linux-6.8.8-arch1-1-x86_64-with (OpenSSL 3.1.4 24 Oct 2023)
[debug] exe versions: ffmpeg 6.1.1 (setts), ffprobe 6.1.1, rtmpdump 2.4
[debug] Optional libraries: Cryptodome-3.20.0, brotli-1.1.0, certifi-2024.02.02, mutagen-1.47.0, requests-2.32.3, secretstorage-3.3.3, sqlite3-3.44.2, urllib3-2.2.1, websockets-12.0
[debug] Proxy map: {}
Extracting cookies from firefox
[debug] Extracting cookies from: "/home/kuylar/.mozilla/firefox/mtlek44v.default-release-1708816247016/cookies.sqlite"
Extracted 2968 cookies from firefox
[debug] Request Handlers: urllib, requests, websockets
[debug] Loaded 1820 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp-nightly-builds/releases/latest
Latest version: nightly@2024.05.30.232720 from yt-dlp/yt-dlp-nightly-builds
yt-dlp is up to date (nightly@2024.05.30.232720 from yt-dlp/yt-dlp-nightly-builds)
[youtube] Extracting URL: dQw4w9WgXcQ
[youtube] dQw4w9WgXcQ: Downloading webpage
[debug] [youtube] Extracted SAPISID cookie
[youtube] dQw4w9WgXcQ: Downloading ios player API JSON
ERROR: [youtube] dQw4w9WgXcQ: Video unavailable. This content isn’t available.
  File "yt_dlp/extractor/common.py", line 734, in extract
  File "yt_dlp/extractor/youtube.py", line 4248, in _real_extract
  File "yt_dlp/extractor/common.py", line 1257, in raise_no_formats

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 28 (10 by maintainers)

Most upvoted comments

@aniqueta I would avoid using cookies entirely and use https://github.com/coletdjnz/yt-dlp-youtube-oauth2 instead. EDIT: oauth is really no different than cookies

You could pass auth and write a txt file of video links from the private playlist with:

--flat-playlist --print-to-file webpage_url links.txt

Then to download them, do not pass auth and feed the list back to yt-dlp with:

yt-dlp -a links.txt

What about using a VPN? I am browsing the internet at home anyway using Wireguard. So I installed it on my server, which runs yt-dlp, but I am still getting the bot message, strange?

@MJBlack9000 if you pass --cookies-from-browser firefox to yt-dlp, does that work around the “sign in” error?

My IP is now limited to 40 kb/s (ios client, no cookie).

If anyone has a solution, I’m interested (there’s no question of using a proxy, since all of them are or will be affected by this problem). Personally, I have no idea how to get around this.

It looks like youtube has won this battle.

Fewer formats, for sure, but not “way” fewer. Many of the iOS client formats are just HLS variants of the WEB formats (exact same quality but different protocol and format id).