Skip to content

Commit

Permalink
[downloader/fragment] Make single thread download work for --live-fro…
Browse files Browse the repository at this point in the history
…m-start (yt-dlp#3446)

Authored by: Lesmiscore
  • Loading branch information
Lesmiscore authored Apr 16, 2022
1 parent e06bd88 commit c854208
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions yt_dlp/downloader/fragment.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,8 +521,13 @@ def _download_fragment(fragment):
for fragment in fragments:
if not interrupt_trigger[0]:
break
download_fragment(fragment, ctx)
result = append_fragment(decrypt_fragment(fragment, self._read_fragment(ctx)), fragment['frag_index'], ctx)
try:
download_fragment(fragment, ctx)
result = append_fragment(decrypt_fragment(fragment, self._read_fragment(ctx)), fragment['frag_index'], ctx)
except KeyboardInterrupt:
if info_dict.get('is_live'):
break
raise
if not result:
return False

Expand Down

0 comments on commit c854208

Please sign in to comment.