def auto_down(url, filename): try: urllib.urlretrieve(url, filename) except urllib.ContentTooShortError: print 'Network conditions is not good.\nReloading.' auto_down(url, filename)