diff --git a/utils/dnscry.pt-merge.py b/utils/dnscry.pt-merge.py new file mode 100755 index 00000000..114b9d98 --- /dev/null +++ b/utils/dnscry.pt-merge.py @@ -0,0 +1,38 @@ +#! /usr/bin/env python3 + +# Origin: https://www.dnscry.pt/resolvers.md + +import sys + + +class Entry: + name = None + description = None + stamps = None + + def __init__(self, name, description, stamps): + self.name = name + self.description = description + self.stamps = stamps + + +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) diff --git a/utils/dnscry.pt-relays-merge.py b/utils/dnscry.pt-relays-merge.py new file mode 100755 index 00000000..cf286749 --- /dev/null +++ b/utils/dnscry.pt-relays-merge.py @@ -0,0 +1,38 @@ +#! /usr/bin/env python3 + +# Origin: https://www.dnscry.pt/anon-relays.md + +import sys + + +class Entry: + name = None + description = None + stamps = None + + def __init__(self, name, description, stamps): + self.name = name + self.description = description + self.stamps = stamps + + +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)