Created
March 21, 2020 14:45
-
-
Save duncanturk/243d26a0390ec8620ff64cbd36d185aa to your computer and use it in GitHub Desktop.
python script that whether a jitsi instance uses googles stun servers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests as req | |
import re | |
domains = [ | |
"jitsi.linux.it", | |
"chat01.kuketz-meet.de" | |
] | |
bad_stuns = { | |
r"stun[\d]{0,1}\.l\.google\.com": "Google" | |
} | |
for domain in domains: | |
page = req.get('https://' + domain + "/testmeeting") | |
if page.status_code != 200: | |
print("error testing " + domain + ": " + page) | |
continue | |
is_bad = False | |
for (bad_stun, reason) in bad_stuns.items(): | |
matches = re.findall("\n.*" + bad_stun, page.text) | |
for match in matches: | |
if "//" not in match: | |
print(domain + " uses " + reason) | |
is_bad = True | |
break | |
if not is_bad: | |
print(domain + " is good") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment