mirror of
https://github.com/catspace-dev/unicheckbot.git
synced 2024-11-21 13:36:37 +03:00
added entry for .cf domain
This commit is contained in:
parent
8ff4d8c16c
commit
8a89e58840
22
apps/tgbot/tgbot/handlers/whois_zones.py
Normal file
22
apps/tgbot/tgbot/handlers/whois_zones.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
from whois.parser import WhoisEntry, PywhoisError, EMAIL_REGEX
|
||||
|
||||
|
||||
class WhoisCf(WhoisEntry):
|
||||
"""Whois parser for .cf domains
|
||||
"""
|
||||
regex = {
|
||||
'domain_name': 'Domain name:\n*(.+)\n',
|
||||
'org': 'Organisation:\n *(.+)',
|
||||
'emails': EMAIL_REGEX,
|
||||
}
|
||||
|
||||
def __init__(self, domain, text):
|
||||
if 'The domain you requested is not known in Freenoms database' in text:
|
||||
raise PywhoisError(text)
|
||||
else:
|
||||
WhoisEntry.__init__(self, domain, text, self.regex)
|
||||
|
||||
|
||||
ZONES = {
|
||||
"cf": WhoisCf
|
||||
}
|
Loading…
Reference in New Issue
Block a user