1
0
Fork 0

try...except for wget

wget.download fails on broken links
Dieser Commit ist enthalten in:
ivan 2017-02-04 11:11:13 +04:00 committet von GitHub
Ursprung 285430534c
Commit 8daca8b780
1 geänderte Dateien mit 4 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -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.")