2022-06-18 12:36:54 +01:00
|
|
|
from typing import Any
|
2022-05-09 14:11:05 +01:00
|
|
|
|
|
|
|
import requests
|
|
|
|
|
|
|
|
from app.terraform import BaseAutomation
|
|
|
|
|
|
|
|
|
|
|
|
class BlockRoskomsvobodaAutomation(BaseAutomation):
|
2022-06-17 12:42:42 +01:00
|
|
|
"""
|
|
|
|
Automation task to import Russian blocklist from RosKomSvoboda.
|
|
|
|
|
|
|
|
This task will import the Russian state register of prohibited sites,
|
|
|
|
which is part of the enforcement of federal laws of the Russian Federation
|
|
|
|
No. 139-FZ, No. 187-FZ, No. 398-FZ and a number of others that regulate
|
|
|
|
the dissemination of information on the Internet.
|
|
|
|
|
|
|
|
Where proxies are found to be blocked they will be rotated.
|
|
|
|
"""
|
2022-05-09 14:11:05 +01:00
|
|
|
short_name = "block_roskomsvoboda"
|
|
|
|
description = "Import Russian blocklist from RosKomSvoboda"
|
2022-05-10 10:37:24 +01:00
|
|
|
frequency = 90
|
2022-05-09 14:11:05 +01:00
|
|
|
|
2022-06-18 12:36:54 +01:00
|
|
|
_data: Any
|
|
|
|
|
|
|
|
def fetch(self):
|
|
|
|
self._data = requests.get("https://reestr.rublacklist.net/api/v2/domains/json").json()
|
|
|
|
|
|
|
|
def parse(self):
|
|
|
|
self.patterns.extend(["https://" + pattern for pattern in self._data])
|