majuna/app/terraform/block_roskomsvoboda.py

30 lines
925 B
Python
Raw Normal View History

from typing import Any
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.
"""
short_name = "block_roskomsvoboda"
description = "Import Russian blocklist from RosKomSvoboda"
frequency = 90
_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])