diff --git a/test.py b/test.py index c4c7f89..b04e908 100644 --- a/test.py +++ b/test.py @@ -24,6 +24,7 @@ google.jp www.google.co.jp +google.io google.co google.de yandex.ru diff --git a/whois/_3_adjust.py b/whois/_3_adjust.py index 7db84c9..6094402 100644 --- a/whois/_3_adjust.py +++ b/whois/_3_adjust.py @@ -53,9 +53,9 @@ def __init__(self, data): '%a %b %d %H:%M:%S %Z %Y', # Tue Jun 21 23:59:59 GMT 2011 '%a %b %d %Y', # Tue Dec 12 2000 '%Y-%m-%dT%H:%M:%S', # 2007-01-26T19:10:31 - '%Y-%m-%dT%H:%M:%SZ', # 2007-01-26T19:10:31Z '%Y-%m-%dt%H:%M:%S.%fz', # 2007-01-26t19:10:31.00z '%Y-%m-%dT%H:%M:%S%z', # 2011-03-30T19:36:27+0200 + '%Y-%m-%dt%H:%M:%S%z', # 2011-03-30t19:36:27+0200 '%Y-%m-%dT%H:%M:%S.%f%z', # 2011-09-08T14:44:51.622265+03:00 '%Y-%m-%dt%H:%M:%S.%f', # 2011-09-08t14:44:51.622265 '%Y%m%d', # 20110908 @@ -81,12 +81,16 @@ def str_to_date(s): def str_to_date_py2(s): tmp = re.findall('\+([0-9]{2})00', s) - if tmp: tz = int(tmp[0]) - else: tz = 0 + if tmp: + dstr=s[:-5] + tz = int(tmp[0]) + else: + dstr=s + tz = 0 for format in DATE_FORMATS: - try: return datetime.datetime.strptime(s, format) + datetime.timedelta(hours=tz) + try: return datetime.datetime.strptime(dstr, format) + datetime.timedelta(hours=tz) except ValueError as e: pass - raise ValueError("Unknown date format: '%s'" % s) + raise ValueError("Unknown date format: '%s' (Origin %s)" % (dstr,s)) diff --git a/whois/tld_regexpr.py b/whois/tld_regexpr.py index 65e6877..805f8d7 100644 --- a/whois/tld_regexpr.py +++ b/whois/tld_regexpr.py @@ -7,7 +7,7 @@ 'creation_date': r'Creation Date:\s?(.+)', 'expiration_date': r'Expiration Date:\s?(.+)', -'updated_date': r'Updated Date:\s?(.+)', +'updated_date': r'Updated Date:\s?(.+)$', 'name_servers': r'Name Server:\s*(.+)\s*', 'status': r'Status:\s?(.+)', @@ -22,6 +22,7 @@ 'extend': 'com', 'creation_date': r'\nCreated On:\s?(.+)', +'expiration_date': r'\nRegistry Expiry Date:\s?(.+)', 'updated_date': r'\nLast Updated On:\s?(.+)', 'name_servers': r'Name Server:\s?(.+)\s*', @@ -143,8 +144,8 @@ 'extend': 'biz', 'creation_date': r'Created On:\s?(.+)', -'expiration_date': r'Expiration Date:\s?(.+)', -'updated_date': r'Last Updated On:\s?(.+)', +'expiration_date': r'Expiration Date:\s?(.+)$', +'updated_date': r'Last Updated On:\s?(.+)$', 'status': r'Status:\s?(.+)', } @@ -247,6 +248,11 @@ 'status': r'status:\s?(.+)', } +io = { +'extend': 'com', +'expiration_date': r'\nRegistry Expiry Date:\s?(.+)', +} + ca = { 'extend': 'com', @@ -292,4 +298,3 @@ 'registrant': r'\nRegistrant Organization:\s?(.+)', 'status': r'\nDomain Status:\s?(.+)', } -