1
0
Fork 0

[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
commit 185bf31070
No known key found for this signature in database
GPG key ID: 0F00D95A001F4698
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: