Repository: yt-dlp
Issue: [youtube] Availability tag doesn't work as intented
Labels: site-enhancement,triage,site:youtube

### DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

- [X] I understand that I will be **blocked** if I *intentionally* remove or skip any mandatory\* field

### Checklist

- [X] I'm reporting that yt-dlp is broken on a **supported** site
- [X] I've verified that I have **updated yt-dlp to nightly or master** ([update instructions](https://github.com/yt-dlp/yt-dlp#update-channels))
- [X] I've checked that all provided URLs are playable in a browser with the same IP and same login details
- [X] I've checked that all URLs and arguments with special characters are [properly quoted or escaped](https://github.com/yt-dlp/yt-dlp/wiki/FAQ#video-url-contains-an-ampersand--and-im-getting-some-strange-output-1-2839-or-v-is-not-recognized-as-an-internal-or-external-command)
- [X] I've searched [known issues](https://github.com/yt-dlp/yt-dlp/issues/3766) and the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues **including closed ones**. DO NOT post duplicates
- [X] I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue)
- [X] I've read about [sharing account credentials](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#are-you-willing-to-share-account-details-if-needed) and I'm willing to share it if required

### Region

Poland

### Provide a description that is worded well enough to be understood

According to the wiki: `availability (string): Whether the video is "private", "premium_only", "subscriber_only", "needs_auth", "unlisted" or "public"`

Well... so from my tests ("print" and "print-to-file") can only output:
- public for public videos,
- unlisted for unlisted videos,
- needs_auth for age restricted videos.

Private, video unavailable, video unavailable due to copyright-infringement leaves empty. But in the console there is and "ERROR" message that the video is private or unavailable. Simply "availability" switch for "print" and "print-to-file" does not print anything.

yt-dlp <put-url-here> --print availability output.txt --skip-download -vU
yt-dlp <put-url-here> --print-to-file availability output.txt --skip-download -vU


links tested:
public: https://www.youtube.com/watch?v=vCwLB8TzFBQ (prints correctly: public)
unlisted: https://www.youtube.com/watch?v=_DfaprsHQZU (prints correctly: unlisted)
not available: https://www.youtube.com/watch?v=EaaXBJr7fkY (prints nothing, only error in the console)
not available - copyright infringement: https://www.youtube.com/watch?v=glMGukgviGY (prints nothing, only error in the console)
private: https://youtube.com/watch?v=pWRVE8P9npM (prints nothing, only error in the console)
age-gated: https://youtube.com/watch?v=HtVdAasjOgU (prints correctly: needs_auth)

I suppose for the videos I have given it should print out the availability to the output file (with the "print-to-file" or to the console with "print").

So the result should be for 6 videos:
public
unlisted
video_not_available
video_not_available_copyright
private
needs_auth

and there is only:
public
unlisted
needs_auth

### Provide verbose output that clearly demonstrates the problem

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

### Complete Verbose Output

```shell
Executing command: yt-dlp https://www.youtube.com/watch?v=vCwLB8TzFBQ --skip-download --print availability -vU
[debug] Command-line config: ['https://www.youtube.com/watch?v=vCwLB8TzFBQ', '--skip-download', '--print', 'availability', '-vU']
[debug] Encodings: locale cp1250, fs utf-8, pref cp1250, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2024.04.09 from yt-dlp/yt-dlp [ff0779267] (win_exe)
[debug] Python 3.8.10 (CPython AMD64 64bit) - Windows-10-10.0.22631-SP0 (OpenSSL 1.1.1k  25 Mar 2021)
[debug] exe versions: ffmpeg 7.0-essentials_build-www.gyan.dev (setts), ffprobe 7.0-essentials_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.20.0, brotli-1.1.0, certifi-2024.02.02, curl_cffi-0.5.10, mutagen-1.47.0, requests-2.31.0, sqlite3-3.35.5, urllib3-2.2.1, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets, curl_cffi
[debug] Loaded 1810 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: stable@2024.04.09 from yt-dlp/yt-dlp
yt-dlp is up to date (stable@2024.04.09 from yt-dlp/yt-dlp)
[youtube] Extracting URL: https://www.youtube.com/watch?v=vCwLB8TzFBQ
[youtube] vCwLB8TzFBQ: Downloading webpage
[youtube] vCwLB8TzFBQ: Downloading ios player API JSON
[youtube] vCwLB8TzFBQ: Downloading android player API JSON
WARNING: [youtube] Skipping player responses from android clients (got player responses for video "aQvGIIdgFDM" instead of "vCwLB8TzFBQ")
[debug] Loading youtube-nsig.7d1f7724 from cache
[debug] [youtube] Decrypted nsig NOm5_SlzT0Vq_YevTH => h9EUJPBppEMVqw
[debug] Loading youtube-nsig.7d1f7724 from cache
[debug] [youtube] Decrypted nsig TuKFIqr_f383iffkYi => 9iWJ3-WCTogdFA
[youtube] vCwLB8TzFBQ: Downloading m3u8 information
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, vcodec:vp9.2, channels, acodec, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), channels, acodec, lang, proto, size, br, asr, vext, aext, hasaud, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] vCwLB8TzFBQ: Downloading 1 format(s): 248+251
public
Executing command: yt-dlp https://www.youtube.com/watch?v=_DfaprsHQZU --skip-download --print availability -vU
[debug] Command-line config: ['https://www.youtube.com/watch?v=_DfaprsHQZU', '--skip-download', '--print', 'availability', '-vU']
[debug] Encodings: locale cp1250, fs utf-8, pref cp1250, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2024.04.09 from yt-dlp/yt-dlp [ff0779267] (win_exe)
[debug] Python 3.8.10 (CPython AMD64 64bit) - Windows-10-10.0.22631-SP0 (OpenSSL 1.1.1k  25 Mar 2021)
[debug] exe versions: ffmpeg 7.0-essentials_build-www.gyan.dev (setts), ffprobe 7.0-essentials_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.20.0, brotli-1.1.0, certifi-2024.02.02, curl_cffi-0.5.10, mutagen-1.47.0, requests-2.31.0, sqlite3-3.35.5, urllib3-2.2.1, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets, curl_cffi
[debug] Loaded 1810 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: stable@2024.04.09 from yt-dlp/yt-dlp
yt-dlp is up to date (stable@2024.04.09 from yt-dlp/yt-dlp)
[youtube] Extracting URL: https://www.youtube.com/watch?v=_DfaprsHQZU
[youtube] _DfaprsHQZU: Downloading webpage
[youtube] _DfaprsHQZU: Downloading ios player API JSON
[youtube] _DfaprsHQZU: Downloading android player API JSON
WARNING: [youtube] Skipping player responses from android clients (got player responses for video "aQvGIIdgFDM" instead of "_DfaprsHQZU")
[debug] [youtube] Extracting signature function js_edea0cc6_107
[debug] Loading youtube-sigfuncs.js_edea0cc6_107 from cache
[debug] Loading youtube-nsig.edea0cc6 from cache
[debug] [youtube] Decrypted nsig hTdCD1Ymev8jf8box3j => zFmjEGgYDL-ZHA
[debug] [youtube] Extracting signature function js_edea0cc6_103
[debug] Loading youtube-sigfuncs.js_edea0cc6_103 from cache
[debug] Loading youtube-nsig.edea0cc6 from cache
[debug] [youtube] Decrypted nsig F-Ot_u_X4BFBDZLy9DH => VimqnV7AbgglwA
[youtube] _DfaprsHQZU: Downloading m3u8 information
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, vcodec:vp9.2, channels, acodec, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), channels, acodec, lang, proto, size, br, asr, vext, aext, hasaud, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] _DfaprsHQZU: Downloading 1 format(s): 303+251
unlisted
Executing command: yt-dlp https://www.youtube.com/watch?v=EaaXBJr7fkY --skip-download --print availability -vU
[debug] Command-line config: ['https://www.youtube.com/watch?v=EaaXBJr7fkY', '--skip-download', '--print', 'availability', '-vU']
[debug] Encodings: locale cp1250, fs utf-8, pref cp1250, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2024.04.09 from yt-dlp/yt-dlp [ff0779267] (win_exe)
[debug] Python 3.8.10 (CPython AMD64 64bit) - Windows-10-10.0.22631-SP0 (OpenSSL 1.1.1k  25 Mar 2021)
[debug] exe versions: ffmpeg 7.0-essentials_build-www.gyan.dev (setts), ffprobe 7.0-essentials_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.20.0, brotli-1.1.0, certifi-2024.02.02, curl_cffi-0.5.10, mutagen-1.47.0, requests-2.31.0, sqlite3-3.35.5, urllib3-2.2.1, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets, curl_cffi
[debug] Loaded 1810 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: stable@2024.04.09 from yt-dlp/yt-dlp
yt-dlp is up to date (stable@2024.04.09 from yt-dlp/yt-dlp)
[youtube] Extracting URL: https://www.youtube.com/watch?v=EaaXBJr7fkY
[youtube] EaaXBJr7fkY: Downloading webpage
[youtube] EaaXBJr7fkY: Downloading ios player API JSON
[youtube] EaaXBJr7fkY: Downloading android player API JSON
WARNING: [youtube] Skipping player responses from android clients (got player responses for video "aQvGIIdgFDM" instead of "EaaXBJr7fkY")
ERROR: [youtube] EaaXBJr7fkY: Video unavailable
  File "yt_dlp\extractor\common.py", line 734, in extract
  File "yt_dlp\extractor\youtube.py", line 4182, in _real_extract
  File "yt_dlp\extractor\common.py", line 1251, in raise_no_formats

Executing command: yt-dlp https://www.youtube.com/watch?v=glMGukgviGY --skip-download --print availability -vU
[debug] Command-line config: ['https://www.youtube.com/watch?v=glMGukgviGY', '--skip-download', '--print', 'availability', '-vU']
[debug] Encodings: locale cp1250, fs utf-8, pref cp1250, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2024.04.09 from yt-dlp/yt-dlp [ff0779267] (win_exe)
[debug] Python 3.8.10 (CPython AMD64 64bit) - Windows-10-10.0.22631-SP0 (OpenSSL 1.1.1k  25 Mar 2021)
[debug] exe versions: ffmpeg 7.0-essentials_build-www.gyan.dev (setts), ffprobe 7.0-essentials_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.20.0, brotli-1.1.0, certifi-2024.02.02, curl_cffi-0.5.10, mutagen-1.47.0, requests-2.31.0, sqlite3-3.35.5, urllib3-2.2.1, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets, curl_cffi
[debug] Loaded 1810 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: stable@2024.04.09 from yt-dlp/yt-dlp
yt-dlp is up to date (stable@2024.04.09 from yt-dlp/yt-dlp)
[youtube] Extracting URL: https://www.youtube.com/watch?v=glMGukgviGY
[youtube] glMGukgviGY: Downloading webpage
[youtube] glMGukgviGY: Downloading ios player API JSON
[youtube] glMGukgviGY: Downloading android player API JSON
WARNING: [youtube] Skipping player responses from android clients (got player responses for video "aQvGIIdgFDM" instead of "glMGukgviGY")
ERROR: [youtube] glMGukgviGY: Video unavailable. This video is no longer available due to a copyright claim by franck keller
  File "yt_dlp\extractor\common.py", line 734, in extract
  File "yt_dlp\extractor\youtube.py", line 4182, in _real_extract
  File "yt_dlp\extractor\common.py", line 1251, in raise_no_formats

Executing command: yt-dlp https://youtube.com/watch?v=pWRVE8P9npM --skip-download --print availability -vU
[debug] Command-line config: ['https://youtube.com/watch?v=pWRVE8P9npM', '--skip-download', '--print', 'availability', '-vU']
[debug] Encodings: locale cp1250, fs utf-8, pref cp1250, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2024.04.09 from yt-dlp/yt-dlp [ff0779267] (win_exe)
[debug] Python 3.8.10 (CPython AMD64 64bit) - Windows-10-10.0.22631-SP0 (OpenSSL 1.1.1k  25 Mar 2021)
[debug] exe versions: ffmpeg 7.0-essentials_build-www.gyan.dev (setts), ffprobe 7.0-essentials_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.20.0, brotli-1.1.0, certifi-2024.02.02, curl_cffi-0.5.10, mutagen-1.47.0, requests-2.31.0, sqlite3-3.35.5, urllib3-2.2.1, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets, curl_cffi
[debug] Loaded 1810 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: stable@2024.04.09 from yt-dlp/yt-dlp
yt-dlp is up to date (stable@2024.04.09 from yt-dlp/yt-dlp)
[youtube] Extracting URL: https://youtube.com/watch?v=pWRVE8P9npM
[youtube] pWRVE8P9npM: Downloading webpage
[youtube] pWRVE8P9npM: Downloading ios player API JSON
[youtube] pWRVE8P9npM: Downloading android player API JSON
WARNING: [youtube] Skipping player responses from android clients (got player responses for video "aQvGIIdgFDM" instead of "pWRVE8P9npM")
ERROR: [youtube] pWRVE8P9npM: Private video. Sign in if you've been granted access to this video
  File "yt_dlp\extractor\common.py", line 734, in extract
  File "yt_dlp\extractor\youtube.py", line 4182, in _real_extract
  File "yt_dlp\extractor\common.py", line 1251, in raise_no_formats

Executing command: yt-dlp https://youtube.com/watch?v=HtVdAasjOgU --skip-download --print availability -vU
[debug] Command-line config: ['https://youtube.com/watch?v=HtVdAasjOgU', '--skip-download', '--print', 'availability', '-vU']
[debug] Encodings: locale cp1250, fs utf-8, pref cp1250, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2024.04.09 from yt-dlp/yt-dlp [ff0779267] (win_exe)
[debug] Python 3.8.10 (CPython AMD64 64bit) - Windows-10-10.0.22631-SP0 (OpenSSL 1.1.1k  25 Mar 2021)
[debug] exe versions: ffmpeg 7.0-essentials_build-www.gyan.dev (setts), ffprobe 7.0-essentials_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.20.0, brotli-1.1.0, certifi-2024.02.02, curl_cffi-0.5.10, mutagen-1.47.0, requests-2.31.0, sqlite3-3.35.5, urllib3-2.2.1, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets, curl_cffi
[debug] Loaded 1810 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: stable@2024.04.09 from yt-dlp/yt-dlp
yt-dlp is up to date (stable@2024.04.09 from yt-dlp/yt-dlp)
[youtube] Extracting URL: https://youtube.com/watch?v=HtVdAasjOgU
[youtube] HtVdAasjOgU: Downloading webpage
[youtube] HtVdAasjOgU: Downloading ios player API JSON
[youtube] HtVdAasjOgU: Downloading tv embedded player API JSON
[youtube] HtVdAasjOgU: Downloading android player API JSON
[youtube] HtVdAasjOgU: Downloading web embedded client config
[youtube] HtVdAasjOgU: Downloading player edea0cc6
[youtube] HtVdAasjOgU: Downloading web embedded player API JSON
WARNING: [youtube] Skipping player responses from android clients (got player responses for video "aQvGIIdgFDM" instead of "HtVdAasjOgU")
[debug] Loading youtube-nsig.edea0cc6 from cache
[debug] [youtube] Decrypted nsig 43OLdizyirJzSe6h0ih => OZJP702sSkeANg
[debug] Loading youtube-nsig.edea0cc6 from cache
[debug] [youtube] Decrypted nsig Dj9QeuBSdF0D9W-mhCh => _LqvUaqRaDiTtQ
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, vcodec:vp9.2, channels, acodec, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), channels, acodec, lang, proto, size, br, asr, vext, aext, hasaud, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] HtVdAasjOgU: Downloading 1 format(s): 248+251
needs_auth
```