--- a/whois/parser.py Mon Aug 18 11:25:39 2014 +0300
+++ b/whois/parser.py Mon Aug 18 11:36:24 2014 +0300
@@ -1,3 +1,5 @@
+# coding=utf-8
+
# parser.py - Module for parsing whois response data
# Copyright (c) 2008 Andrey Petrov
#
@@ -158,6 +160,8 @@
return WhoisPt(domain, text)
elif domain.endswith('.bg'):
return WhoisBg(domain, text)
+ elif domain.endswith('.рф'):
+ return WhoisRf(domain, text)
else:
return WhoisEntry(domain, text)
@@ -619,3 +623,16 @@
raise PywhoisError(text)
else:
WhoisEntry.__init__(self, domain, text, self.regex)
+
+class WhoisRf(WhoisEntry):
+ """Whois parser for .bg domains"""
+
+ regex = {
+ 'expiration_date': 'free-date:\s*(.+)',
+ }
+
+ def __init__(self, domain, text):
+ if text.strip() == 'No entries found':
+ raise PywhoisError(text)
+ else:
+ WhoisEntry.__init__(self, domain, text, self.regex)