From 131efd1ae0899f261fe9faccb91f5c9c3aa974c5 Mon Sep 17 00:00:00 2001 From: Ricardo Garcia Date: Sat, 17 Apr 2010 18:49:56 +0200 Subject: [PATCH] Detect errors in video data writes --- youtube-dl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/youtube-dl b/youtube-dl index d2bd0bf5f..86e247994 100755 --- a/youtube-dl +++ b/youtube-dl @@ -566,7 +566,10 @@ class FileDownloader(object): except (OSError, IOError), err: self.trouble('ERROR: unable to open for writing: %s' % str(err)) return False - stream.write(data_block) + try: + stream.write(data_block) + except (IOError, OSError), err: + self.trouble('ERROR: unable to write data: %s' % str(err)) block_size = self.best_block_size(after - before, data_block_len) # Progress message -- 2.40.0