From: James Bunton Date: Sat, 13 Oct 2012 22:36:36 +0000 (+1100) Subject: fixed CLI download X-Git-Url: https://code.delx.au/youtube-cgi/commitdiff_plain/0872bf6ff47e5817a748dfcf4c8acaa077f29801 fixed CLI download --- diff --git a/youtube.cgi b/youtube.cgi index 5e612d4..8b103be 100755 --- a/youtube.cgi +++ b/youtube.cgi @@ -298,7 +298,7 @@ def main(): try: copy_with_progress(content_length, video_data, outfile) - except IOError: + except IOError, e: print video_data.close() @@ -308,7 +308,8 @@ def main(): if old_offset == offset: time.sleep(1) print "Restarting download from", pp_size(offset) - continue + else: + break outfile.close()