diff --git a/app/terraform/block_external.py b/app/terraform/block_external.py index e648b94..56de93d 100644 --- a/app/terraform/block_external.py +++ b/app/terraform/block_external.py @@ -35,7 +35,16 @@ class BlockExternalAutomation(BlockMirrorAutomation): def fetch(self) -> None: user_agent = {'User-agent': 'BypassCensorship/1.0'} - self._data = requests.get(app.config['EXTERNAL_CHECK_URL'], headers=user_agent, timeout=30).json() + if isinstance(app.config.get('EXTERNAL_CHECK_URL', []), list): + check_urls = app.config['EXTERNAL_CHECK_URL'] + elif isinstance(app.config.get('EXTERNAL_CHECK_URL'), str): + check_urls = [app.config['EXTERNAL_CHECK_URL']] + else: + check_urls = [] + for check_url in check_urls: + if self._data is None: + self._data = [] + self._data.extend(requests.get(check_url, headers=user_agent, timeout=30).json()) def parse(self) -> None: self.patterns.extend(["https://" + trim_http_https(pattern) for pattern in self._data])