try...except for wget

wget.download fails on broken links
このコミットが含まれているのは:
ivan 2017-02-04 11:11:13 +04:00 committed by GitHub
コミット 8daca8b780
1個のファイルの変更4行の追加1行の削除

ファイルの表示

@ -39,6 +39,9 @@ lastindex = int(lastindex)
while index <= lastindex:
filename = str(index) + "." + extension
url = prefix + str(index) + postfix
wget.download(url,out=filename)
try:
wget.download(url,out=filename)
except:
print ("...skipped...")
index = index + 1
print ("Donwload finished.")