A feature-rich command-line audio/video downloader
Py2 compatibility for `FileNotFoundError`
pukkandan88728713c82c
diff --git a/yt_dlp/downloader/dash.py b/yt_dlp/downloader/dash.pyindex 65dc69f7ef..03ed5df548 100644--- a/yt_dlp/downloader/dash.py+++ b/yt_dlp/downloader/dash.py@@ -1,5 +1,6 @@from __future__ import unicode_literals+import errnotry:import concurrent.futurescan_threaded_download = True@@ -126,7 +127,10 @@ class DashSegmentsFD(FragmentFD):file.close()self._append_fragment(ctx, frag_content)return True- except FileNotFoundError:+ except EnvironmentError as ose:+ if ose.errno != errno.ENOENT:+ raise+ # FileNotFoundErrorif skip_unavailable_fragments:self.report_skip_fragment(frag_index)return Truediff --git a/yt_dlp/downloader/hls.py b/yt_dlp/downloader/hls.pyindex 67b09144d6..f4e41a6c7b 100644--- a/yt_dlp/downloader/hls.py+++ b/yt_dlp/downloader/hls.py@@ -1,5 +1,6 @@from __future__ import unicode_literals+import errnoimport reimport binasciitry:@@ -316,7 +317,10 @@ class HlsFD(FragmentFD):file.close()self._append_fragment(ctx, frag_content)return True- except FileNotFoundError:+ except EnvironmentError as ose:+ if ose.errno != errno.ENOENT:+ raise+ # FileNotFoundErrorif skip_unavailable_fragments:self.report_skip_fragment(frag_index)return True