--- a/whois/parser.py Fri Mar 21 12:09:00 2014 -0400
+++ b/whois/parser.py Mon Aug 11 15:23:49 2014 +0300
@@ -31,6 +31,7 @@
'%Y-%m-%d %H:%M:%SZ', # 2000-08-22 18:55:20Z
'%Y-%m-%d %H:%M:%S', # 2000-08-22 18:55:20
'%d %b %Y %H:%M:%S', # 08 Apr 2013 05:44:00
+ '%d/%m/%Y %H:%M:%S.%f %Z', # 23/04/2015 12:00:07.619546 EEST
]
for known_format in known_formats:
@@ -153,6 +154,8 @@
return WhoisKr(domain, text)
elif domain.endswith('.pt'):
return WhoisPt(domain, text)
+ elif domain.endswith('.bg'):
+ return WhoisBg(domain, text)
else:
return WhoisEntry(domain, text)
@@ -601,3 +604,16 @@
raise PywhoisError(text)
else:
WhoisEntry.__init__(self, domain, text, self.regex)
+
+class WhoisBg(WhoisEntry):
+ """Whois parser for .bg domains"""
+
+ regex = {
+ 'expiration_date': 'expires at:\s*(.+)',
+ }
+
+ def __init__(self, domain, text):
+ if text.strip() == 'No entries found':
+ raise PywhoisError(text)
+ else:
+ WhoisEntry.__init__(self, domain, text, self.regex)