summaryrefslogtreecommitdiffstats
path: root/download.py
diff options
context:
space:
mode:
Diffstat (limited to 'download.py')
-rw-r--r--download.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/download.py b/download.py
index 63040c9..b9f9f72 100644
--- a/download.py
+++ b/download.py
@@ -93,6 +93,9 @@ def get_image_links(baseurl, t = []):
return mysubparser.get_hyperlinks()
def get_images(t = []):
+ skipped = 0
+ failed = 0
+ downloaded = 0
total = len(t)
progress = progressbar.Progress(total)
i = 1
@@ -107,12 +110,16 @@ def get_images(t = []):
break
except IOError:
tries -= 1
- print "\rDownloading of", link, "failed,", tries, "left"
+ if tries == 0:
+ failed += 1
+ else:
+ downloaded += 1
else:
- print "\rNot downloading", link, "already downloaded"
+ skipped += 1
i += 1
progress.complete()
+ return (skipped, failed, downloaded, total)
if __name__ == "__main__":
# Get a file-like object for the 4chan.org w/imgboard