Skip to content

Commit

Permalink
Import the dnscry.pt-merge scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
jedisct1 committed Sep 18, 2024
1 parent 09b83f1 commit 2805f6f
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
38 changes: 38 additions & 0 deletions utils/dnscry.pt-merge.py
Original file line number Diff line number Diff line change
@@ -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)
38 changes: 38 additions & 0 deletions utils/dnscry.pt-relays-merge.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 2805f6f

Please sign in to comment.