try...except for wget
wget.download fails on broken links
This commit is contained in:
parent
285430534c
commit
8daca8b780
|
@ -39,6 +39,9 @@ lastindex = int(lastindex)
|
||||||
while index <= lastindex:
|
while index <= lastindex:
|
||||||
filename = str(index) + "." + extension
|
filename = str(index) + "." + extension
|
||||||
url = prefix + str(index) + postfix
|
url = prefix + str(index) + postfix
|
||||||
|
try:
|
||||||
wget.download(url,out=filename)
|
wget.download(url,out=filename)
|
||||||
|
except:
|
||||||
|
print ("...skipped...")
|
||||||
index = index + 1
|
index = index + 1
|
||||||
print ("Donwload finished.")
|
print ("Donwload finished.")
|
||||||
|
|
Loading…
Reference in New Issue