From 7669c16c74a5f971932fa45d46d079ecb1a59378 Mon Sep 17 00:00:00 2001 From: Terrtia Date: Mon, 15 May 2023 10:42:46 +0200 Subject: [PATCH] fix: [Onion module] fix kvrocks sismeber --- bin/lib/crawlers.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bin/lib/crawlers.py b/bin/lib/crawlers.py index 4d97ef18..2a9c2a01 100755 --- a/bin/lib/crawlers.py +++ b/bin/lib/crawlers.py @@ -267,7 +267,11 @@ class Cookiejar: r_crawler.hset(f'cookiejar:meta:{self.uuid}', 'level', level) def is_cookie_in_jar(self, cookie_uuid): - return r_crawler.sismember(f'cookiejar:cookies:{self.uuid}', cookie_uuid) + # kvrocks sismember TEMP fix + try: + return r_crawler.sismember(f'cookiejar:cookies:{self.uuid}', cookie_uuid) + except: + return False def get_cookies_uuid(self): return r_crawler.smembers(f'cookiejar:cookies:{self.uuid}') @@ -677,7 +681,11 @@ def get_blacklist(): return r_crawler.smembers('blacklist:domain') def is_blacklisted_domain(domain): - return r_crawler.sismember('blacklist:domain', domain) + # kvrocks sismember TEMP fix + try: + return r_crawler.sismember('blacklist:domain', domain) + except: + return False def blacklist_domain(domain): return r_crawler.sadd('blacklist:domain', domain)