Skip to content

Commit 3cb7626

Browse files
Merge pull request #290 from brondsem/update-not-founds
handle more WhoisDomainNotFoundError situations
2 parents 4a9c0a4 + 9ddb23d commit 3cb7626

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

whois/parser.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ class WhoisNl(WhoisEntry):
623623
}
624624

625625
def __init__(self, domain: str, text: str):
626-
if text.endswith("is free"):
626+
if text.rstrip().endswith("is free"):
627627
raise WhoisDomainNotFoundError(text)
628628
else:
629629
WhoisEntry.__init__(self, domain, text, self.regex)
@@ -944,7 +944,7 @@ class WhoisFr(WhoisEntry):
944944
}
945945

946946
def __init__(self, domain: str, text: str):
947-
if "No entries found" in text:
947+
if "No entries found" in text or "NOT FOUND" in text:
948948
raise WhoisDomainNotFoundError(text)
949949
else:
950950
WhoisEntry.__init__(self, domain, text, self.regex)
@@ -1033,7 +1033,7 @@ class WhoisAU(WhoisEntry):
10331033
}
10341034

10351035
def __init__(self, domain: str, text: str):
1036-
if text.strip() == "No Data Found":
1036+
if text.strip() == "No Data Found" or text.lstrip().startswith("Domain not found"):
10371037
raise WhoisDomainNotFoundError(text)
10381038
else:
10391039
WhoisEntry.__init__(self, domain, text, self.regex)
@@ -1085,7 +1085,7 @@ class WhoisEu(WhoisEntry):
10851085
}
10861086

10871087
def __init__(self, domain: str, text: str):
1088-
if text.strip() == "Status: AVAILABLE":
1088+
if text.strip() == "Status: AVAILABLE" or "Status: AVAILABLE" in text:
10891089
raise WhoisDomainNotFoundError(text)
10901090
else:
10911091
WhoisEntry.__init__(self, domain, text, self.regex)
@@ -1147,7 +1147,7 @@ class WhoisBr(WhoisEntry):
11471147
}
11481148

11491149
def __init__(self, domain: str, text: str):
1150-
if "Not found:" in text:
1150+
if "Not found:" in text or "No match for " in text:
11511151
raise WhoisDomainNotFoundError(text)
11521152
else:
11531153
WhoisEntry.__init__(self, domain, text, self.regex)
@@ -1279,7 +1279,7 @@ class WhoisAt(WhoisEntry):
12791279
}
12801280

12811281
def __init__(self, domain: str, text: str):
1282-
if "Status: free" in text:
1282+
if "Status: free" in text or text.rstrip().endswith('nothing found'):
12831283
raise WhoisDomainNotFoundError(text)
12841284
else:
12851285
WhoisEntry.__init__(self, domain, text, self.regex)
@@ -1301,7 +1301,7 @@ class WhoisBe(WhoisEntry):
13011301
}
13021302

13031303
def __init__(self, domain: str, text: str):
1304-
if "Status: AVAILABLE" in text:
1304+
if "Status: AVAILABLE" in text or "Status:\tAVAILABLE" in text:
13051305
raise WhoisDomainNotFoundError(text)
13061306
else:
13071307
WhoisEntry.__init__(self, domain, text, self.regex)
@@ -1540,7 +1540,7 @@ class WhoisIo(WhoisEntry):
15401540
}
15411541

15421542
def __init__(self, domain: str, text: str):
1543-
if "is available for purchase" in text:
1543+
if "is available for purchase" in text or 'Domain not found.' in text:
15441544
raise WhoisDomainNotFoundError(text)
15451545
else:
15461546
WhoisEntry.__init__(self, domain, text, self.regex)
@@ -1868,7 +1868,7 @@ class WhoisIt(WhoisEntry):
18681868
}
18691869

18701870
def __init__(self, domain: str, text: str):
1871-
if "not found." in text:
1871+
if "not found." in text or "Status: AVAILABLE" in text:
18721872
raise WhoisDomainNotFoundError(text)
18731873
else:
18741874
WhoisEntry.__init__(self, domain, text, self.regex)
@@ -2083,7 +2083,7 @@ class WhoisDk(WhoisEntry):
20832083
}
20842084

20852085
def __init__(self, domain: str, text: str):
2086-
if "No match for " in text:
2086+
if "No match for " in text or "No entries found for the selected source" in text:
20872087
raise WhoisDomainNotFoundError(text)
20882088
else:
20892089
WhoisEntry.__init__(self, domain, text, self.regex)
@@ -2154,7 +2154,7 @@ class WhoisAi(WhoisEntry):
21542154
}
21552155

21562156
def __init__(self, domain: str, text: str):
2157-
if "not registered" in text:
2157+
if "not registered" in text or text.startswith("Domain not found."):
21582158
raise WhoisDomainNotFoundError(text)
21592159
else:
21602160
WhoisEntry.__init__(self, domain, text, self.regex)
@@ -2211,7 +2211,7 @@ class WhoisIn(WhoisEntry):
22112211
}
22122212

22132213
def __init__(self, domain: str, text: str):
2214-
if "NOT FOUND" in text:
2214+
if "NOT FOUND" in text or "is available for registration" in text:
22152215
raise WhoisDomainNotFoundError(text)
22162216
else:
22172217
WhoisEntry.__init__(self, domain, text, self.regex)

0 commit comments

Comments
 (0)