diff options
author | ryuslash | 2010-04-22 22:24:38 +0200 |
---|---|---|
committer | ryuslash | 2010-04-22 22:24:38 +0200 |
commit | ef79c9991b55975157607c6d7b0cca52a6929023 (patch) | |
tree | 3baf1307ce5700189c7bb7e7a3b43705dbfcbe10 /download.py | |
parent | 99b87aeffb9412ad7a0cc1f795fd6af89cf4eb76 (diff) | |
download | 4grab-ef79c9991b55975157607c6d7b0cca52a6929023.tar.gz 4grab-ef79c9991b55975157607c6d7b0cca52a6929023.zip |
Nasty bug where it didn't actually save anything
Diffstat (limited to 'download.py')
-rw-r--r-- | download.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/download.py b/download.py index 42fcd52..eeec200 100644 --- a/download.py +++ b/download.py @@ -23,6 +23,7 @@ import htmlparser import config import sys import backend +import util def get_savedir(): conf = config.Configuration() @@ -125,6 +126,8 @@ class Downloader(object): progress.show_progress(i) filename = os.path.join(get_savedir(), os.path.split(link)[1]) if not check_archive(filename): + util.log(util.LogType.Msg, "%s is not in archive" % filename, None) + tries = 10 while tries > 0: try: @@ -135,10 +138,15 @@ class Downloader(object): if tries == 0: failed += 1 else: + util.log(util.LogType.Msg, "succsesfully downloaded %s" % filename, None) downloaded += 1 if self.on_downloaded is not None: + util.log(util.LogType.Msg, "", self.on_downloaded) + if not self.on_downloaded(filename): failed += 1 + else: + util.log(util.LogType.Warn, "on_downloaded is None", None) else: skipped += 1 i += 1 |