Repository: yt-dlp
Issue: [Youtube] Abort download on missing formats warnings
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 requesting a site-specific feature
- [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 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)
- [ ] 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

_No response_

### Example URLs

https://www.youtube.com/watch?v=BaW_jenozKc

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

Some warnings can indicate when formats will be missing, such as `nsig extraction failed: Some formats may be missing` and `Webpage contains broken formats (poToken experiment detected)`.

The download will continue in both cases.

As far as I can tell, there is no way to abort the current download on specific warnings (or in general).

Since yt-dlp can detect it, can a feature to abort the download be implemented for warnings that are known to result in missing formats?

I think one or more extractor args somewhat like `--extractor-args "youtube:raise_incomplete_data"` can be implemented to solve this, by changing the warning(s) to terminating errors, or otherwise stopping the download of the current video.

Maybe called `abort_on_missing_formats` or `abort_on_nsig`, `abort_on_potoken` or something along those lines

### Provide verbose output that clearly demonstrates the problem

- [X] 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
- [X] Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below

### Complete Verbose Output

```shell
#nsig warning example, using stable@2024.08.01

[debug] Command-line config: ['-s', '-v', 'https://www.youtube.com/watch?v=BaW_jenozKc']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2024.08.01 from yt-dlp/yt-dlp [ffd7781d6] (zip)
[debug] Python 3.10.14 (CPython x86_64 64bit) - Linux-6.5.0-1025-gcp-x86_64-with-glibc2.39 (OpenSSL 3.0.13 30 Jan 2024, glibc 2.39)
[debug] exe versions: none
[debug] Optional libraries: sqlite3-3.45.3
[debug] Proxy map: {}
[debug] Request Handlers: urllib
[debug] Loaded 1830 extractors
[youtube] Extracting URL: https://www.youtube.com/watch?v=BaW_jenozKc
[youtube] BaW_jenozKc: Downloading webpage
[youtube] BaW_jenozKc: Downloading ios player API JSON
[youtube] BaW_jenozKc: Downloading tv player API JSON
[debug] Loading youtube-nsig.28fd7348 from cache
WARNING: [youtube] BaW_jenozKc: nsig extraction failed: Some formats may be missing
         Install PhantomJS to workaround the issue. Please download it from https://phantomjs.org/download.html
         n = jlWd3dJO0yUeGN10P ; player = https://www.youtube.com/s/player/28fd7348/player_ias.vflset/en_US/base.js
[debug] [youtube] slice must be applied on a list in: a.slice(0,0); please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
[debug] Loading youtube-nsig.28fd7348 from cache
WARNING: [youtube] BaW_jenozKc: nsig extraction failed: Some formats may be missing
         Install PhantomJS to workaround the issue. Please download it from https://phantomjs.org/download.html
         n = BUk_TAYzaUBCVVz0a ; player = https://www.youtube.com/s/player/28fd7348/player_ias.vflset/en_US/base.js
[youtube] BaW_jenozKc: 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: best/bestvideo+bestaudio
[info] BaW_jenozKc: Downloading 1 format(s): 137+140
```