From bfb1e6b181b31ec07da1e4bdfa72b1eff93183ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Tue, 2 Nov 2021 14:58:31 -0700 Subject: [PATCH] fix: Use default_public for all capture, including if submitted via the API --- bin/async_capture.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/async_capture.py b/bin/async_capture.py index 361519e..c42775b 100755 --- a/bin/async_capture.py +++ b/bin/async_capture.py @@ -51,14 +51,20 @@ class AsyncCapture(AbstractManager): to_capture: Dict[str, str] = self.redis.hgetall(uuid) + if get_config('generic', 'default_public'): + # By default, the captures are on the index, unless the user mark them as un-listed + listing = False if ('listing' in to_capture and to_capture['listing'].lower() in ['false', '0', '']) else True + else: + # By default, the captures are not on the index, unless the user mark them as listed + listing = True if ('listing' in to_capture and to_capture['listing'].lower() in ['true', '1']) else False + self.logger.info(f'Capturing {to_capture["url"]} - {uuid}') success, error_message = self._capture( to_capture['url'], perma_uuid=uuid, cookies_pseudofile=to_capture.get('cookies', None), depth=int(to_capture.get('depth', 1)), - # By default, the captures are on the index, unless the user mark them as un-listed - listing=False if ('listing' in to_capture and to_capture['listing'].lower() in ['false', '0', '']) else True, + listing=listing, user_agent=to_capture.get('user_agent', None), referer=to_capture.get('referer', None), proxy=to_capture.get('proxy', None),