From 72dfec0c3532941a46f77b3c0a6a49e16e6a2864 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 5 Aug 2019 12:52:31 +0200 Subject: Manage excluded domains --- commcrawler/management/commands/launch_crawl.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'commcrawler/management') diff --git a/commcrawler/management/commands/launch_crawl.py b/commcrawler/management/commands/launch_crawl.py index 92c3081..1248eeb 100644 --- a/commcrawler/management/commands/launch_crawl.py +++ b/commcrawler/management/commands/launch_crawl.py @@ -3,7 +3,7 @@ import sys from django.core.management.base import BaseCommand -from commcrawler.models import Crawl +from commcrawler.models import Crawl, ExludedDomains from commcrawler.scrapy import launch_crawl @@ -57,5 +57,7 @@ class Command(BaseCommand): except ValueError: c_id = None current_crawl = crawls[c_id] - launch_crawl(current_crawl) + excluded = [domain.split("://")[1] for domain in + ExludedDomains.objects.all()] + launch_crawl(current_crawl, excluded_domains=excluded) -- cgit v1.2.3