From 918e8b8c9355868d6cf8f1e607e5288ed478acea Mon Sep 17 00:00:00 2001 From: Maniacikarus Date: Sat, 8 Nov 2008 12:53:06 +0100 Subject: [PATCH] Added timestamp to downloader --- download/getfile.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/download/getfile.py b/download/getfile.py index c503e71b..4631ed09 100644 --- a/download/getfile.py +++ b/download/getfile.py @@ -5,6 +5,7 @@ import random import urllib2 import urlparse import cgi +import time from mimetypes import guess_type access = open("access.log", "a") @@ -64,6 +65,7 @@ class Server: f = urllib2.urlopen("%s" % urlparse.urljoin(self.url(), file)) except (urllib2.HTTPError, urllib2.URLError), e: if error: + error.write("%s " % time.asctime()) error.write("ERR 500 - %s %s\n" % (self.url(), e)) else: ret = f.geturl() @@ -126,6 +128,7 @@ while servers.all(): print "Pragma: no-cache" print + access.write("%s " % time.asctime()) access.write("%s\n" % url) break @@ -139,6 +142,7 @@ else: print if error: + error.write("%s " % time.asctime()) error.write("ERR 404 - %s wasn't found on any server" % file) access.close() -- 2.47.3