GodsDevProject commited on
Commit
9e153b7
·
verified ·
1 Parent(s): 9c8150d

Create ingest/generic_public_foia.py

Browse files
Files changed (1) hide show
  1. ingest/generic_public_foia.py +4 -2
ingest/generic_public_foia.py CHANGED
@@ -1,7 +1,7 @@
1
  import abc
2
  import asyncio
3
  from typing import List, Dict
4
- from ingest.utils import can_fetch
5
 
6
  class GenericFOIAAdapter(abc.ABC):
7
  source_name: str = "UNKNOWN"
@@ -20,7 +20,9 @@ class GenericFOIAAdapter(abc.ABC):
20
  self._last_call = asyncio.get_event_loop().time()
21
 
22
  def robots_allowed(self) -> bool:
23
- return can_fetch(self.base_url)
 
 
24
 
25
  @abc.abstractmethod
26
  async def search(self, query: str) -> List[Dict]:
 
1
  import abc
2
  import asyncio
3
  from typing import List, Dict
4
+ from ingest.utils import robots_allowed
5
 
6
  class GenericFOIAAdapter(abc.ABC):
7
  source_name: str = "UNKNOWN"
 
20
  self._last_call = asyncio.get_event_loop().time()
21
 
22
  def robots_allowed(self) -> bool:
23
+ if not self.base_url:
24
+ return False
25
+ return robots_allowed(self.base_url)
26
 
27
  @abc.abstractmethod
28
  async def search(self, query: str) -> List[Dict]: