diff options
author | Lesmiscore (Naoya Ozaki) <nao20010128@gmail.com> | 2022-04-16 21:11:09 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-16 21:11:09 +0900 |
commit | c854208ccf7938fa58b3bfbee6cb5bfd6432f11a (patch) | |
tree | b3fb1e0ba3ce896c0b4a147a176503958f9ffa28 | |
parent | e06bd8800fb98e9dc1537e9f1ebf3aaeea5d9b8c (diff) | |
download | hypervideo-pre-c854208ccf7938fa58b3bfbee6cb5bfd6432f11a.tar.lz hypervideo-pre-c854208ccf7938fa58b3bfbee6cb5bfd6432f11a.tar.xz hypervideo-pre-c854208ccf7938fa58b3bfbee6cb5bfd6432f11a.zip |
[downloader/fragment] Make single thread download work for --live-from-start (#3446)
Authored by: Lesmiscore
-rw-r--r-- | yt_dlp/downloader/fragment.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/yt_dlp/downloader/fragment.py b/yt_dlp/downloader/fragment.py index 9012a1795..2a97cfd16 100644 --- a/yt_dlp/downloader/fragment.py +++ b/yt_dlp/downloader/fragment.py @@ -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 |