Skip to content

Commit 0152904

Browse files
committed
Add centiseconds to wget download file
to distinguish files downloaded almost at the same time example: 2014-09-29 16:26:51+0200 [HTTPPageDownloader,client] Saving URL (http://www.frade8c.com:9162/root) to dl/20140929162651_http___www_frade8c_com_9162_root 2014-09-29 16:26:52+0200 [HTTPPageDownloader,client] Saving URL (http://www.frade8c.com:9162/root) to dl/20140929162651_http___www_frade8c_com_9162_root 2014-09-29 16:26:52+0200 [HTTPPageDownloader,client] Saving URL (http://www.frade8c.com:9162/root) to dl/20140929162651_http___www_frade8c_com_9162_root
1 parent 9bce85c commit 0152904

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

kippo/commands/wget.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,12 @@ def start(self):
9393
if cfg.has_option('honeypot', 'download_limit_size'):
9494
self.limit_size = int(cfg.get('honeypot', 'download_limit_size'))
9595

96-
self.safeoutfile = '%s/%s_%s' % \
96+
centiseconds = str("%0.2f" % time.time()).split('.')[1]
97+
98+
self.safeoutfile = '%s/%s_%s_%s' % \
9799
(cfg.get('honeypot', 'download_path'),
98100
time.strftime('%Y%m%d%H%M%S'),
101+
centiseconds,
99102
re.sub('[^A-Za-z0-9]', '_', url))
100103
self.deferred = self.download(url, outfile, self.safeoutfile)
101104
if self.deferred:

0 commit comments

Comments
 (0)