X-Git-Url: https://code.delx.au/youtube-cgi/blobdiff_plain/91b4e0c202d9fe530c1b4648ac34d8691c8ac50d..0872bf6ff47e5817a748dfcf4c8acaa077f29801:/youtube.cgi 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()