diff options
Diffstat (limited to 'download.py')
-rw-r--r-- | download.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/download.py b/download.py index 7508a50..42fcd52 100644 --- a/download.py +++ b/download.py @@ -22,6 +22,7 @@ import os import htmlparser import config import sys +import backend def get_savedir(): conf = config.Configuration() @@ -30,12 +31,10 @@ def get_savedir(): os.makedirs(savedir) return savedir def check_archive(fullpath): - conf = config.Configuration() - archive = conf.get_archive_location() filename = os.path.basename(fullpath) - archfile = os.path.join(archive, filename) - #sys.stderr.write("%s %d\n" % (archfile, os.path.exists(archfile))) - return os.path.exists(archfile) + be = backend.Backend() + return be.check(filename) + def write(message): sys.stdout.write(message) sys.stdout.flush() @@ -145,6 +144,10 @@ class Downloader(object): i += 1 progress.complete() + + be = backend.Backend() + be.save() + return (skipped, failed, downloaded, total) if __name__ == "__main__": |