diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-07-07 01:55:54 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-07-07 01:55:54 +0530 |
commit | 723d44b92b52479360d889c864a19b25ce14978e (patch) | |
tree | 18e3bbe03260eca1249a892c0b19c002e3572a11 | |
parent | bc97cdae67b292a4d807e07d65cae345a2f41dbd (diff) | |
download | hypervideo-pre-723d44b92b52479360d889c864a19b25ce14978e.tar.lz hypervideo-pre-723d44b92b52479360d889c864a19b25ce14978e.tar.xz hypervideo-pre-723d44b92b52479360d889c864a19b25ce14978e.zip |
[fragment] Handle errors in threads correctly
-rw-r--r-- | yt_dlp/downloader/fragment.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/yt_dlp/downloader/fragment.py b/yt_dlp/downloader/fragment.py index c499e5e2b..8e211c766 100644 --- a/yt_dlp/downloader/fragment.py +++ b/yt_dlp/downloader/fragment.py @@ -402,13 +402,9 @@ class FragmentFD(FileDownloader): if can_threaded_download and max_workers > 1: def _download_fragment(fragment): - try: - ctx_copy = ctx.copy() - frag_content, frag_index = download_fragment(fragment, ctx_copy) - return fragment, frag_content, frag_index, ctx_copy.get('fragment_filename_sanitized') - except Exception: - # Return immediately on exception so that it is raised in the main thread - return + ctx_copy = ctx.copy() + frag_content, frag_index = download_fragment(fragment, ctx_copy) + return fragment, frag_content, frag_index, ctx_copy.get('fragment_filename_sanitized') self.report_warning('The download speed shown is only of one thread. This is a known issue and patches are welcome') with concurrent.futures.ThreadPoolExecutor(max_workers) as pool: |