Import the dnscry.pt-merge scripts

This commit is contained in:
Frank Denis 2024-09-18 18:27:38 +02:00
parent 09b83f18af
commit a12fd83347
2 changed files with 54 additions and 0 deletions

27
utils/dnscry.pt-merge.py Executable file
View File

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

27
utils/dnscry.pt-relays-merge.py Executable file
View File

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