Repository: yt-dlp
Issue: [BiliIntl] Download Failed at midway 
Labels: geo-blocked,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 reporting a bug unrelated to a specific site
- [X] I've verified that I'm running yt-dlp version **2023.07.06** ([update instructions](https://github.com/yt-dlp/yt-dlp#update)) or later (specify commit)
- [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

Download got failed on midway...

### 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
root@ps:/media/Jellymed/EXT/temp# yt-dlp --version
2023.07.06
root@ps:/media/Jellymed/EXT/temp# yt-dlp --cookies Cookies_En.txt -vU -f 14+2 https://www.bilibili.tv/en/video/2043748658
[debug] Command-line config: ['--cookies', 'Cookies_En.txt', '-vU', '-f', '14+2', 'https://www.bilibili.tv/en/video/2043748658']
[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@2023.07.06 [b532a3481] (pip)
[debug] Python 3.9.2 (CPython x86_64 64bit) - Linux-5.10.0-25-amd64-x86_64-with-glibc2.31 (OpenSSL 1.1.1n  15 Mar 2022, glibc 2.31)
[debug] exe versions: ffmpeg 4.3.6-0, ffprobe 4.3.6-0
[debug] Optional libraries: Cryptodome-3.16.0, brotli-1.0.9, certifi-2022.12.07, mutagen-1.46.0, sqlite3-2.6.0, websockets-10.4
[debug] Proxy map: {}
[debug] Loaded 1855 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Available version: stable@2023.07.06, Current version: stable@2023.07.06
yt-dlp is up to date (stable@2023.07.06)
[BiliIntl] Extracting URL: https://www.bilibili.tv/en/video/2043748658
[BiliIntl] 2043748658: Downloading webpage
[BiliIntl] 2043748658: Downloading video formats
[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] 2043748658: Downloading 1 format(s): 14+2
[debug] Invoking http downloader on "https://upos-bstar1-mirrorakam.akamaized.net/iupxcodeboss/ui/m5/n220918adj82d58xr3fzgc5pflypm5ui-1-161210110000.m4s?e=ig8euxZM2rNcNbdlhoNvNC8BqJIzNbfqXBvEqxTEto8BTrNvN0GvT90W5JZMkX_YN0MvXg8gNEV4NC8xNEV4N03eN0B5tZlqNxTEto8BTrNvNeZVuJ10Kj_g2UB02J0mN0B5tZlqNCNEto8BTrNvNC7MTX502C8f2jmMQJ6mqF2fka1mqx6gqj0eN0B599M=&uipk=5&nbs=1&deadline=1694046547&gen=playurlv2&os=akam&oi=2417516152&trid=88baf13c6eae4f70a5d1688316bcacaci&mid=1531530638&platform=pc&upsig=a8b7e77c84e20941c833021423c14213&uparams=e,uipk,nbs,deadline,gen,os,oi,trid,mid,platform&hdnts=exp=1694046547~hmac=dfe301a727eacd0041a769d8a4053eec80ece169c4c8e281c221ed791ec4ab3a&bvc=vod&nettype=0&orderid=0,1&logo=00000000&f=i_0_0"
[download] Destination: Twice - 4th World Tour III in Japan [2022.04.23] [2043748658].f14.mp4
[download]  57.6% of    3.46GiB at   45.56MiB/s ETA 00:32[download] Got error: Downloaded 2143289344 bytes, expected 3719059183 bytes. Retrying (1/10)...
[download] Got error: Remote end closed connection without response. Retrying (2/10)...
[download] Got error: Remote end closed connection without response. Retrying (3/10)...
[download] Got error: Remote end closed connection without response. Retrying (4/10)...
[download] Got error: Remote end closed connection without response. Retrying (5/10)...
[download] Got error: Remote end closed connection without response. Retrying (6/10)...
[download] Got error: Remote end closed connection without response. Retrying (7/10)...
[download] Got error: Remote end closed connection without response. Retrying (8/10)...
[download] Got error: Remote end closed connection without response. Retrying (9/10)...
[download] Got error: Remote end closed connection without response. Retrying (10/10)...
[download] Got error: Remote end closed connection without response. Giving up after 10 retries
  File "/usr/local/bin/yt-dlp", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/__init__.py", line 1008, in main
    _exit(*variadic(_real_main(argv)))
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/__init__.py", line 998, in _real_main
    return ydl.download(all_urls)
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/YoutubeDL.py", line 3485, in download
    self.__download_wrapper(self.extract_info)(
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/YoutubeDL.py", line 3460, in wrapper
    res = func(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/YoutubeDL.py", line 1549, 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 1560, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/YoutubeDL.py", line 1709, 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 1768, 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 2897, in process_video_result
    self.process_info(new_info)
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/YoutubeDL.py", line 3345, in process_info
    partial_success, real_download = self.dl(fname, new_info)
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/YoutubeDL.py", line 3084, in dl
    return fd.download(name, new_info, subtitle)
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/downloader/common.py", line 461, in download
    ret = self.real_download(filename, info_dict)
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/downloader/http.py", line 375, 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 5634, 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 402, in report_retry
    RetryManager.report_retry(
  File "/usr/local/lib/python3.9/dist-packages/yt_dlp/utils/_utils.py", line 5641, 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 405, 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 1042, 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 970, in trouble
    tb_data = traceback.format_list(traceback.extract_stack())


[debug] Invoking http downloader on "https://upos-bstar1-mirrorakam.akamaized.net/iupxcodeboss/ui/m5/n220918adj82d58xr3fzgc5pflypm5ui-1-1d1301000023.m4s?e=ig8euxZM2rNcNbdlhoNvNC8BqJIzNbfqXBvEqxTEto8BTrNvN0GvT90W5JZMkX_YN0MvXg8gNEV4NC8xNEV4N03eN0B5tZlqNxTEto8BTrNvNeZVuJ10Kj_g2UB02J0mN0B5tZlqNCNEto8BTrNvNC7MTX502C8f2jmMQJ6mqF2fka1mqx6gqj0eN0B599M=&uipk=5&nbs=1&deadline=1694046547&gen=playurlv2&os=akam&oi=2417516152&trid=88baf13c6eae4f70a5d1688316bcacaci&mid=1531530638&platform=pc&upsig=bd66be4ad470af57099a11ac2906a66a&uparams=e,uipk,nbs,deadline,gen,os,oi,trid,mid,platform&hdnts=exp=1694046547~hmac=abbbc48c6ceb7a05d276ca544df7690248e9bbe4843fdaedf8f27294603e23b4&bvc=vod&nettype=0&orderid=0,1&logo=00000000&f=i_0_0"
[download] Destination: Twice - 4th World Tour III in Japan [2022.04.23] [2043748658].f2.mp4
[download] 100% of  209.46MiB in 00:00:05 at 37.38MiB/s
root@ps:/media/Jellymed/EXT/temp#
```