try:
copy_with_progress(content_length, video_data, outfile)
- except IOError:
+ except IOError, e:
print
video_data.close()
if old_offset == offset:
time.sleep(1)
print "Restarting download from", pp_size(offset)
- continue
+ else:
+ break
outfile.close()