diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2019-01-27 11:36:29 +0100 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2019-01-27 11:36:29 +0100 |
commit | 0af80da0b506a06593c81d3686e91b8b82a4f3ba (patch) | |
tree | f2593b60c3842b4ee8be6d60f6f76e707c6a4237 /crocoite/cli.py | |
parent | 668cc5e10c7097d51ba4e4fcae02f55d89283923 (diff) | |
download | crocoite-0af80da0b506a06593c81d3686e91b8b82a4f3ba.tar.gz crocoite-0af80da0b506a06593c81d3686e91b8b82a4f3ba.tar.bz2 crocoite-0af80da0b506a06593c81d3686e91b8b82a4f3ba.zip |
irc: Add URL blacklist
Diffstat (limited to 'crocoite/cli.py')
-rw-r--r-- | crocoite/cli.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crocoite/cli.py b/crocoite/cli.py index b73051b..be3538a 100644 --- a/crocoite/cli.py +++ b/crocoite/cli.py @@ -132,7 +132,7 @@ def recursive (): return 0 def irc (): - import json + import json, re from .irc import Chromebot logger = Logger (consumer=[DatetimeConsumer (), JsonPrintConsumer ()]) @@ -145,6 +145,7 @@ def irc (): with open (args.config) as fd: config = json.load (fd) s = config['irc'] + blacklist = dict (map (lambda x: (re.compile (x[0], re.I), x[1]), config['blacklist'].items ())) loop = asyncio.get_event_loop() bot = Chromebot ( @@ -157,6 +158,7 @@ def irc (): destdir=config['destdir'], processLimit=config['process_limit'], logger=logger, + blacklist=blacklist, loop=loop) stop = lambda signum: bot.cancel () loop.add_signal_handler (signal.SIGINT, stop, signal.SIGINT) |