dnscrypt-resolvers/utils/dnscry.pt-relays-merge.py
2024-09-19 06:41:17 +02:00

26 lines
555 B
Python
Executable File

#! /usr/bin/env python3
# Origin: https://www.dnscry.pt/anon-relays.md
import sys
in_header = True
with sys.stdin as f:
while True:
line = f.readline()
if not line:
break
if in_header == True:
if line.startswith("## "):
in_header = False
else:
continue
if line.startswith("## "):
name = line.split("## ")[1]
name = f"dnscry.pt-{name}".replace(" ", "")
print(f"## {name}")
else:
print(line)