Repository: yt-dlp
Issue: Cannot download ended streams from Twitch with `--download-sections`
Labels: site-bug,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 asking a question and **not** reporting a bug or requesting a feature
- [X] I've looked through the [README](https://github.com/yt-dlp/yt-dlp#readme)
- [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 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 questions **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)

### Please make sure the question is worded well enough to be understood

It fails when attempts to partially download [an ended stream](https://www.twitch.tv/videos/2000427166) on Twitch, and reports `Error opening input: End of file`.

### 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
[debug] Command-line config: ['-vU', '-f', '1080p60', '--download-sections', '*02:11:38-02:57:36', 'https://www.twitch.tv/videos/2000427166']
[debug] Encodings: locale cp950, fs utf-8, pref cp950, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2023.11.16 from yt-dlp/yt-dlp [24f827875] (win_exe)
[debug] Python 3.8.10 (CPython AMD64 64bit) - Windows-10-10.0.19045-SP0 (OpenSSL 1.1.1k  25 Mar 2021)
[debug] exe versions: ffmpeg 6.1-essentials_build-www.gyan.dev (setts), ffprobe 6.1-essentials_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.19.0, brotli-1.1.0, certifi-2023.07.22, mutagen-1.47.0, requests-2.31.0, sqlite3-3.35.5, urllib3-2.1.0, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests
[debug] Loaded 1901 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest                               Latest version: stable@2023.11.16 from yt-dlp/yt-dlp
yt-dlp is up to date (stable@2023.11.16 from yt-dlp/yt-dlp)
[twitch:vod] Extracting URL: https://www.twitch.tv/videos/2000427166
[twitch:vod] 2000427166: Downloading stream metadata GraphQL
[twitch:vod] 2000427166: Downloading video access token GraphQL
[twitch:vod] 2000427166: Downloading m3u8 information
[twitch:vod] 2000427166: Downloading storyboard metadata JSON
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, hdr:12(7), vcodec:vp9.2(10), channels, acodec, size, br, asr, proto, vext, aext, hasaud, source, id
[info] v2000427166: Downloading 1 format(s): 1080p60
[info] v2000427166: Downloading 1 time ranges: 7898.0-10656.0
[debug] Invoking ffmpeg downloader on "https://d3vd9lfkzbru3h.cloudfront.net/3cf1410674e8c9e4c467_restiafps_40871599943_1702218170/chunked/index-dvr.m3u8"
[download] Destination: 有掉寶 來玩下新模式 !VPN [v2000427166].mp4
[debug] ffmpeg command line: ffmpeg -y -loglevel verbose -headers "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.93 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
" -ss 7898.0 -t 2758.0 -i "https://d3vd9lfkzbru3h.cloudfront.net/3cf1410674e8c9e4c467_restiafps_40871599943_1702218170/chunked/index-dvr.m3u8" -c copy -f mp4 "file:有掉寶 來玩下新模式 !VPN [v2000427166].mp4.part"
ffmpeg version 6.1-essentials_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 12.2.0 (Rev10, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --pkg-config=pkgconf --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-dxva2 --enable-d3d11va --enable-libvpl --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
  libavutil      58. 29.100 / 58. 29.100
  libavcodec     60. 31.102 / 60. 31.102
  libavformat    60. 16.100 / 60. 16.100
  libavdevice    60.  3.100 / 60.  3.100
  libavfilter     9. 12.100 /  9. 12.100
  libswscale      7.  5.100 /  7.  5.100
  libswresample   4. 12.100 /  4. 12.100
  libpostproc    57.  3.100 / 57.  3.100
[tcp @ 000002addd71bb00] Starting connection attempt to 13.33.189.88 port 443
[tcp @ 000002addd71bb00] Successfully connected to 13.33.189.88 port 443
[tls @ 000002addd7219c0] Error in the pull function.
[tls @ 000002addd7219c0] IO error: End of file
[in#0 @ 000002addd71e580] Error opening input: End of file
Error opening input file https://d3vd9lfkzbru3h.cloudfront.net/3cf1410674e8c9e4c467_restiafps_40871599943_1702218170/chunked/index-dvr.m3u8.
Error opening input files: End of file


ERROR: ffmpeg exited with code 3753488571
  File "yt_dlp\__main__.py", line 17, in <module>
  File "yt_dlp\__init__.py", line 1008, in main
  File "yt_dlp\__init__.py", line 998, in _real_main
  File "yt_dlp\YoutubeDL.py", line 3511, in download
  File "yt_dlp\YoutubeDL.py", line 3486, in wrapper
  File "yt_dlp\YoutubeDL.py", line 1556, in extract_info
  File "yt_dlp\YoutubeDL.py", line 1567, in wrapper
  File "yt_dlp\YoutubeDL.py", line 1723, in __extract_info
  File "yt_dlp\YoutubeDL.py", line 1782, in process_ie_result
  File "yt_dlp\YoutubeDL.py", line 2922, in process_video_result
  File "yt_dlp\YoutubeDL.py", line 3388, in process_info
  File "yt_dlp\YoutubeDL.py", line 3109, in dl
  File "yt_dlp\downloader\common.py", line 455, in download
  File "yt_dlp\downloader\external.py", line 80, in real_download
  File "yt_dlp\YoutubeDL.py", line 1045, in report_error
  File "yt_dlp\YoutubeDL.py", line 973, in trouble
```