Skip to content

Commit

Permalink
Muda inicialização de allowed_domains em base diof (#1360)
Browse files Browse the repository at this point in the history
  • Loading branch information
trevineju authored Jan 29, 2025
2 parents ea4fc4f + b4ad2ba commit 338dbbe
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions data_collection/gazette/spiders/base/diof.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,19 @@ class BaseDiofSpider(BaseGazetteSpider):

api_url = "https://diof.io.org.br/api"

def start_requests(self):
self._set_allowed_domains()
def __init__(self, *args, **kwargs):
super(BaseDiofSpider, self).__init__(*args, **kwargs)

domains = {
"sai.io.org.br",
"dom.imap.org.br",
"diof.io.org.br",
urlparse(self.website).netloc,
}
self.allowed_domains = list(domains)

if "sai.io" or "dom.imap" in self.website:
def start_requests(self):
if "sai.io" in self.website or "dom.imap" in self.website:
yield Request(
self.website,
callback=self.interval_request,
Expand Down Expand Up @@ -126,15 +135,6 @@ def collect_gazette(self, response, metadata, optional_url):

yield Gazette(**metadata)

def _set_allowed_domains(self):
domains = {
"sai.io.org.br",
"dom.imap.org.br",
"diof.io.org.br",
urlparse(self.website).netloc,
}
self.allowed_domains = list(domains)

def _get_client_id(self, response):
if "sai.io" in response.url:
self.client_id = re.search(
Expand Down

0 comments on commit 338dbbe

Please sign in to comment.