1
0
Fork 0
mirror of https://codeberg.org/polarisfm/youtube-dl.git synced 2024-12-27 01:56:52 +00:00

Detect errors in video data writes

This commit is contained in:
Ricardo Garcia 2010-04-17 18:49:56 +02:00
parent 2bebb386b8
commit 131efd1ae0

View file

@ -566,7 +566,10 @@ class FileDownloader(object):
except (OSError, IOError), err: except (OSError, IOError), err:
self.trouble('ERROR: unable to open for writing: %s' % str(err)) self.trouble('ERROR: unable to open for writing: %s' % str(err))
return False return False
try:
stream.write(data_block) 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) block_size = self.best_block_size(after - before, data_block_len)
# Progress message # Progress message