From 54d31e514d4d9b77f6effaea0f02b3e98e7d7f48 Mon Sep 17 00:00:00 2001 From: e00E Date: Sun, 1 Nov 2015 15:35:29 +0100 Subject: [PATCH] Fix stdout with new native hls --- youtube_dl/downloader/fragment.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/youtube_dl/downloader/fragment.py b/youtube_dl/downloader/fragment.py index 8ac150d4f..34c27b349 100644 --- a/youtube_dl/downloader/fragment.py +++ b/youtube_dl/downloader/fragment.py @@ -49,7 +49,10 @@ class FragmentFD(FileDownloader): def _start_frag_download(self, ctx): total_frags = ctx['total_frags'] - downloaded_bytes = os.path.getsize(ctx['tmpfilename']) if ctx.get('continue_dl') else 0 + try: + downloaded_bytes = os.path.getsize(ctx['tmpfilename']) if ctx.get('continue_dl') else 0 + except os.error as e: + downloaded_bytes = 0 frag_index = ctx['continue_fragment'] + 1 if ctx.get('continue_fragment') else 0 # This dict stores the download progress, it's updated by the progress # hook