From 788648aeb0dd87aad6ff9bee75173599825d863c Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Fri, 4 Sep 2020 15:49:21 +0200 Subject: [PATCH] fix style --- respodns/checks.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/respodns/checks.py b/respodns/checks.py index 889d20c..381bffc 100644 --- a/respodns/checks.py +++ b/respodns/checks.py @@ -2,15 +2,20 @@ from .top1m import retrieve_top1m_entries from .util import concat_nonsense, rot13, head from .structs import Check + def order_by_failures(checks): # descending return sorted(checks, key=lambda check: -check.failures) + first = [ # checking this first this avoids issues with censorship in China. see: # https://www.bortzmeyer.org/sichuan-pepper.html Check("common", "baidu.com", 491), ] +_sinkhole = "iuqerfsodp9ifjaposdfjhgosurijfaewrwergwea.com" +_weirdsub = concat_nonsense("javarevisited.blogspot.com") + likely = order_by_failures([ # these checks are, in practice, the most likely # to weed out unwanted DNS servers. @@ -33,7 +38,7 @@ likely = order_by_failures([ Check("gambling", "bet365.com", 157), Check("gambling", "betonline.ag", 168), Check("gambling", "unibet.com", 137), - Check("infosec", "iuqerfsodp9ifjaposdfjhgosurijfaewrwergwea.com", 98), + Check("infosec", _sinkhole, 98), Check("infosec", "scan.shadowserver.org", 73), Check("news", "huanqiu.com", 435), Check("news", "telegram.com", 71), @@ -45,7 +50,7 @@ likely = order_by_failures([ Check("uncommon", "react.uni-saarland.de", 74), Check("usercontent", "4chan.org", 116), # Check("weird", "archive.is", 0), - Check("weirdsub", concat_nonsense("javarevisited.blogspot.com"), 126), + Check("weirdsub", _weirdsub, 126), ]) unlikely = order_by_failures([