[downloader/fragment] Make single thread download work for --live-from-start (#3446)

Authored by: Lesmiscore
pull/3454/head
Lesmiscore (Naoya Ozaki) 2022-04-16 21:11:09 +09:00 zatwierdzone przez GitHub
rodzic e06bd8800f
commit c854208ccf
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 7 dodań i 2 usunięć

Wyświetl plik

@ -521,8 +521,13 @@ class FragmentFD(FileDownloader):
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