From 6092f482e6037a76b28b067ebe4be425772e2ef3 Mon Sep 17 00:00:00 2001 From: kovacsbalu Date: Wed, 15 May 2019 09:57:18 +0200 Subject: [PATCH] Fix crawler rotation Before this, crawler processed prioritized onions and after all starts prioritized regular. --- bin/Crawler.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/Crawler.py b/bin/Crawler.py index d8e6a430..31f2d594 100755 --- a/bin/Crawler.py +++ b/bin/Crawler.py @@ -12,6 +12,7 @@ import time import subprocess import requests +from collections import deque from pyfaup.faup import Faup sys.path.append(os.environ['AIL_BIN']) @@ -303,7 +304,7 @@ if __name__ == '__main__': #mode = sys.argv[1] splash_port = sys.argv[1] - rotation_mode = ['onion', 'regular'] + rotation_mode = deque(["onion", "regular"]) default_proto_map = {'http': 80, 'https': 443} ######################################################## add ftp ??? @@ -361,6 +362,7 @@ if __name__ == '__main__': update_auto_crawler() + rotation_mode.rotate() to_crawl = get_elem_to_crawl(rotation_mode) if to_crawl: url_data = unpack_url(to_crawl['url'])