Repository: yt-dlp
Issue: Download error aborts although it should try process another format according to docs
Labels: enhancement,core-triage

### 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 a bug unrelated to a specific 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)

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

I've seen similar issues around here saying that particular format could be somehow corrupted which is also probably this case. But docs says that `no-abort-on-error` is default setting which says:

> Continue with next video on download errors; e.g. to skip unavailable videos in a playlist (default)

In my case there are 2 formats being downloaded: 22, 299+251. It raises error when downloading 22 and aborts process. I would expect skiping this format and moving to another one. Thanks

### 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
2024-01-22 16:51:58,235:PID 130:USER_ID 0:DEBUG /var/lib/encoder/worker/scripts/youtube.py@86: b[width=160][protocol!=http_dash_segments][fps<=?4.0][vcodec~='^(avc|h264)'],b[width=1280][protocol!=http_dash_segments][fps<=?60.0][vcodec~='^(avc|h264)'],b[width=1920][protocol!=http_dash_segments][fps<=?60.0][vcodec~='^(avc|h264)']/bv[width=1920][protocol!=http_dash_segments][fps<=?60.0][vcodec~='^(avc|h264)']+ba[protocol!=http_dash_segments]/b[width>=1920]/bv[width>=1920]+ba/b[width>=160]/bv[width>=160]+ba,
2024-01-22 16:51:58,258:PID 130:USER_ID 0:DEBUG /var/lib/encoder/worker/scripts/youtube.py@181: [debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8 (No ANSI), error utf-8 (No ANSI), screen utf-8 (No ANSI)
2024-01-22 16:51:58,258:PID 130:USER_ID 0:DEBUG /var/lib/encoder/worker/scripts/youtube.py@181: [debug] yt-dlp version stable@2023.12.30 from yt-dlp/yt-dlp [f10589e34] (pip) API
2024-01-22 16:51:58,258:PID 130:USER_ID 0:DEBUG /var/lib/encoder/worker/scripts/youtube.py@181: [debug] params: {'format': "b[width=160][protocol!=http_dash_segments][fps<=?4.0][vcodec~='^(avc|h264)'],b[width=1280][protocol!=http_dash_segments][fps<=?60.0][vcodec~='^(avc|h264)'],b[width=1920][protocol!=http_dash_segments][fps<=?60.0][vcodec~='^(avc|h264)']/bv[width=1920][protocol!=http_dash_segments][fps<=?60.0][vcodec~='^(avc|h264)']+ba[protocol!=http_dash_segments]/b[width>=1920]/bv[width>=1920]+ba/b[width>=160]/bv[width>=160]+ba,", 'outtmpl': '/var/lib/encoder/worker/tmp/source/%(id)s_%(format_id)s.%(ext)s', 'merge_output_format': 'mp4', 'remuxvideo': 'mp4', 'logger': <__main__.YtLogger object at 0x7f5c0e43c880>, 'progress_hooks': [<function YoutubeEncoder.yt_download.<locals>.yt_progress_hook at 0x7f5c0e43b820>], 'nocachedir': True, 'verbose': True, 'abort-on-error': False, 'compat_opts': set(), 'http_headers': {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language': 'en-us,en;q=0.5', 'Sec-Fetch-Mode': 'navigate'}}
2024-01-22 16:51:58,263:PID 130:USER_ID 0:DEBUG /var/lib/encoder/worker/scripts/youtube.py@181: [debug] Python 3.9.2 (CPython x86_64 64bit) - Linux-5.15.0-91-generic-x86_64-with-glibc2.31 (OpenSSL 1.1.1k  25 Mar 2021, glibc 2.31)
2024-01-22 16:51:58,383:PID 130:USER_ID 0:DEBUG /var/lib/encoder/worker/scripts/youtube.py@181: [debug] exe versions: ffmpeg 4.3.3-0, ffprobe 4.3.3-0
2024-01-22 16:51:58,383:PID 130:USER_ID 0:DEBUG /var/lib/encoder/worker/scripts/youtube.py@181: [debug] Optional libraries: Cryptodome-3.20.0, brotli-1.1.0, certifi-2023.11.17, mutagen-1.47.0, requests-2.31.0, sqlite3-3.34.1, urllib3-2.1.0, websockets-12.0
2024-01-22 16:51:58,383:PID 130:USER_ID 0:DEBUG /var/lib/encoder/worker/scripts/youtube.py@181: [debug] Proxy map: {}
2024-01-22 16:51:58,384:PID 130:USER_ID 0:DEBUG /var/lib/encoder/worker/scripts/youtube.py@181: [debug] Request Handlers: urllib, requests, websockets
2024-01-22 16:51:58,455:PID 130:USER_ID 0:DEBUG /var/lib/encoder/worker/scripts/youtube.py@181: [debug] Loaded 1798 extractors
2024-01-22 16:51:58,492:PID 130:USER_ID 0:DEBUG /var/lib/encoder/worker/scripts/youtube.py@181: [youtube] Extracting URL: https://www.youtube.com/watch?v=esrO1CocQ9w
2024-01-22 16:51:58,493:PID 130:USER_ID 0:DEBUG /var/lib/encoder/worker/scripts/youtube.py@181: [youtube] esrO1CocQ9w: Downloading webpage
2024-01-22 16:51:59,072:PID 130:USER_ID 0:DEBUG /var/lib/encoder/worker/scripts/youtube.py@181: [youtube] esrO1CocQ9w: Downloading ios player API JSON
2024-01-22 16:51:59,180:PID 130:USER_ID 0:DEBUG /var/lib/encoder/worker/scripts/youtube.py@181: [youtube] esrO1CocQ9w: Downloading android player API JSON
2024-01-22 16:51:59,257:PID 130:USER_ID 0:DEBUG /var/lib/encoder/worker/scripts/youtube.py@181: [debug] Loading youtube-nsig.787e9b63 from cache
2024-01-22 16:51:59,896:PID 130:USER_ID 0:DEBUG /var/lib/encoder/worker/scripts/youtube.py@181: [debug] [youtube] Decrypted nsig b_kKgjSHUzvKvOfhZ => CzD-rs8cIQr2Cw
2024-01-22 16:51:59,897:PID 130:USER_ID 0:DEBUG /var/lib/encoder/worker/scripts/youtube.py@181: [youtube] esrO1CocQ9w: Downloading m3u8 information
2024-01-22 16:52:00,127:PID 130:USER_ID 0:DEBUG /var/lib/encoder/worker/scripts/youtube.py@181: [debug] Sort order given by extractor: quality, res, fps, hdr:12, source, vcodec:vp9.2, channels, acodec, lang, proto
2024-01-22 16:52:00,128:PID 130:USER_ID 0:DEBUG /var/lib/encoder/worker/scripts/youtube.py@181: [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
2024-01-22 16:52:00,183:PID 130:USER_ID 0:DEBUG /var/lib/encoder/worker/scripts/youtube.py@181: [info] esrO1CocQ9w: Downloading 2 format(s): 22, 299+251
2024-01-22 16:52:00,229:PID 130:USER_ID 0:DEBUG /var/lib/encoder/worker/scripts/youtube.py@181: [debug] Invoking http downloader on "https://rr2---sn-8vq54voxj1-2gbl.googlevideo.com/videoplayback?expire=1705960319&ei=H4-uZbyQDOWDi9oPp7aE4AE&ip=89.177.75.96&id=o-AFMSXgtnnUrMQul5j4lpSuiWCk2BLtamxci9EMTEIAiq&itag=22&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&mh=G9&mm=31%2C29&mn=sn-8vq54voxj1-2gbl%2Csn-2gb7snez&ms=au%2Crdu&mv=m&mvi=2&pl=22&initcwndbps=1511250&spc=UWF9f1psxjBVvh-C5mXbxrI5v10HD8QHcTKi&vprv=1&svpuc=1&mime=video%2Fmp4&cnr=14&ratebypass=yes&dur=127.941&lmt=1705806190459133&mt=1705938306&fvip=5&fexp=24007246&c=ANDROID&txp=3308224&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Ccnr%2Cratebypass%2Cdur%2Clmt&sig=AJfQdSswRAIgC1Bt8dPl2eqHpNZvZdPMvadJ3pNfpmX0KRncYwKEAAQCIGOeBHcP9f8AeXJPUbVhiPoydfl7Bmci9YRBD8z5LPCI&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AAO5W4owRQIgehJ6-8GFi9SP2OJJSw-nHItMJNR1WPQ-dy2zWe0izxACIQDtoWz3PNpKIIYCubRTdE4LSbrcKZ5opGWWjmU3GdnzDg%3D%3D"
2024-01-22 16:52:00,229:PID 130:USER_ID 0:DEBUG /var/lib/encoder/worker/scripts/youtube.py@181: [download] Resuming download at byte 33359144
[download] Got error: 0 bytes read, 698559 more expected/encoder/worker/scripts/youtube.py@187: ERROR: 
2024-01-22 16:52:00,482:PID 130:USER_ID 0:ERROR /var/lib/encoder/worker/scripts/youtube.py@187:   File "/var/lib/encoder/worker/scripts/youtube.py", line 195, in <module>
    main(sys.argv[1], sys.argv[2])
  File "/var/lib/encoder/worker/scripts/youtube.py", line 192, in main
    inst.run()
  File "/var/lib/encoder/worker/scripts/encode.py", line 979, in run
    self.go()
  File "/var/lib/encoder/worker/scripts/encode.py", line 948, in go
    video_list = self.download()
  File "/var/lib/encoder/worker/scripts/youtube.py", line 117, in download
    meta = self.yt_download(self.queue_info['url'])
  File "/var/lib/encoder/worker/scripts/youtube.py", line 101, in yt_download
    meta = ydl.extract_info(url)
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/YoutubeDL.py", line 1576, in extract_info
    return self.__extract_info(url, self.get_info_extractor(key), download, extra_info, process)
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/YoutubeDL.py", line 1587, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/YoutubeDL.py", line 1743, in __extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/YoutubeDL.py", line 1802, in process_ie_result
    ie_result = self.process_video_result(ie_result, download=download)
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/YoutubeDL.py", line 2952, in process_video_result
    self.process_info(new_info)
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/YoutubeDL.py", line 3418, in process_info
    success, real_download = self.dl(temp_filename, info_dict)
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/YoutubeDL.py", line 3139, in dl
    return fd.download(name, new_info, subtitle)
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/downloader/common.py", line 455, in download
    ret = self.real_download(filename, info_dict)
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/downloader/http.py", line 362, in real_download
    for retry in RetryManager(self.params.get('retries'), self.report_retry):
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/utils/_utils.py", line 5046, in __iter__
    self.error_callback(self.error, self.attempt, self.retries)
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/downloader/common.py", line 401, in report_retry
    RetryManager.report_retry(
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/utils/_utils.py", line 5053, in report_retry
    return error(f'{e}. Giving up after {count - 1} retries') if count > 1 else error(str(e))
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/downloader/common.py", line 404, in <lambda>
    error=IDENTITY if not fatal else lambda e: self.report_error(f'\r[download] Got error: {e}'),
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/YoutubeDL.py", line 1054, in report_error
    self.trouble(f'{self._format_err("ERROR:", self.Styles.ERROR)} {message}', *args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/YoutubeDL.py", line 982, in trouble
    tb_data = traceback.format_list(traceback.extract_stack())

2024-01-22 16:52:00,483:PID 130:USER_ID 0:ERROR /var/lib/encoder/worker/scripts/encode.py@985: Traceback (most recent call last):
  File "/var/lib/encoder/worker/scripts/encode.py", line 979, in run
    self.go()
  File "/var/lib/encoder/worker/scripts/encode.py", line 948, in go
    video_list = self.download()
  File "/var/lib/encoder/worker/scripts/youtube.py", line 117, in download
    meta = self.yt_download(self.queue_info['url'])
  File "/var/lib/encoder/worker/scripts/youtube.py", line 101, in yt_download
    meta = ydl.extract_info(url)
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/YoutubeDL.py", line 1576, in extract_info
    return self.__extract_info(url, self.get_info_extractor(key), download, extra_info, process)
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/YoutubeDL.py", line 1587, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/YoutubeDL.py", line 1743, in __extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/YoutubeDL.py", line 1802, in process_ie_result
    ie_result = self.process_video_result(ie_result, download=download)
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/YoutubeDL.py", line 2952, in process_video_result
    self.process_info(new_info)
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/YoutubeDL.py", line 3418, in process_info
    success, real_download = self.dl(temp_filename, info_dict)
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/YoutubeDL.py", line 3139, in dl
    return fd.download(name, new_info, subtitle)
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/downloader/common.py", line 455, in download
    ret = self.real_download(filename, info_dict)
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/downloader/http.py", line 362, in real_download
    for retry in RetryManager(self.params.get('retries'), self.report_retry):
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/utils/_utils.py", line 5046, in __iter__
    self.error_callback(self.error, self.attempt, self.retries)
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/downloader/common.py", line 401, in report_retry
    RetryManager.report_retry(
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/utils/_utils.py", line 5053, in report_retry
    return error(f'{e}. Giving up after {count - 1} retries') if count > 1 else error(str(e))
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/downloader/common.py", line 404, in <lambda>
    error=IDENTITY if not fatal else lambda e: self.report_error(f'\r[download] Got error: {e}'),
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/YoutubeDL.py", line 1054, in report_error
    self.trouble(f'{self._format_err("ERROR:", self.Styles.ERROR)} {message}', *args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/YoutubeDL.py", line 993, in trouble
    raise DownloadError(message, exc_info)
[download] Got error: 0 bytes read, 698559 more expected
```