majuna/app/terraform/block/block_scriptzteam.py

23 lines
736 B
Python
Raw Normal View History

import requests
from app.terraform.block.bridge_bridgelines import BlockBridgelinesAutomation
class BlockBridgeScriptzteamAutomation(BlockBridgelinesAutomation):
"""
Automation task to rotate bridges discovered by scriptzteam.
"""
short_name = "block_bridge_scriptzteam"
description = "Import bridges discovered by scriptzteam from GitHub"
frequency = 300 # They only update every couple of days as of February 2023
def fetch(self) -> None:
r = requests.get(
"https://raw.githubusercontent.com/scriptzteam/Tor-Bridges-Collector/main/bridges-obfs4",
2024-12-06 18:15:47 +00:00
timeout=60,
)
r.encoding = "utf-8"
contents = r.text
self._lines = contents.splitlines()