Browse Source

try...except for wget

wget.download fails on broken links
master
ivan 2 years ago
parent
commit
8daca8b780
1 changed files with 4 additions and 1 deletions
  1. 4
    1
      pyelibdownloader.py

+ 4
- 1
pyelibdownloader.py View File

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

Loading…
Cancel
Save