From 0ab67becff23abf7b83f70bc909af144aff88125 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Thu, 22 Dec 2022 07:20:26 +0000 Subject: [PATCH] Give option for only crawling some boards --- sources/ch4.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sources/ch4.py b/sources/ch4.py index 7adec89..06864c4 100644 --- a/sources/ch4.py +++ b/sources/ch4.py @@ -25,6 +25,9 @@ CRAWL_DELAY = int(getenv("MONOLITH_CH4_CRAWL_DELAY", 5)) # Semaphore value ? THREADS_SEMAPHORE = int(getenv("MONOLITH_CH4_THREADS_SEMAPHORE", 1000)) +# Boards to crawl +BOARDS = getenv("MONOLITH_CH4_BOARDS", "").split(",") + # CONFIGURATION END # @@ -58,7 +61,10 @@ class Chan4(object): self.log.debug(f"Decoded hash key: {self.hash_key}") async def run(self): - await self.get_board_list() + if not BOARDS: + await self.get_board_list() + else: + self.boards = BOARDS while True: await self.get_thread_lists(self.boards) await asyncio.sleep(CRAWL_DELAY)