1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-10-03 23:43:21 -04:00

[youtube] End live-from-start properly when stream ends with 403

Closes #2089
This commit is contained in:
pukkandan
2021-12-26 15:49:35 +05:30
parent 0b77924a38
commit 185bf31070
2 changed files with 27 additions and 18 deletions

View File

@@ -433,6 +433,7 @@ class FragmentFD(FileDownloader):
def download_fragment(fragment, ctx):
frag_index = ctx['fragment_index'] = fragment['frag_index']
ctx['last_error'] = None
if not interrupt_trigger[0]:
return False, frag_index
headers = info_dict.get('http_headers', {}).copy()
@@ -455,6 +456,7 @@ class FragmentFD(FileDownloader):
# See https://github.com/ytdl-org/youtube-dl/issues/10165,
# https://github.com/ytdl-org/youtube-dl/issues/10448).
count += 1
ctx['last_error'] = err
if count <= fragment_retries:
self.report_retry_fragment(err, frag_index, count, fragment_retries)
except DownloadError: