whois
whois copied to clipboard
.im expiry date is format dd/mm/YYYY and not mm/dd/YYYY
Hi
I found a little inconsistency (registrar fault 😇 )
I created a small script to check the expiration of my domains and found that one of the domains does not return a date in mm/dd/YYYY but in dd/mm/YYYY. This domain is however parsed by PyWhois and return a datetime mm/dd/YYYY.
For example my domain dryusdan.im expire on 7 decembre 2022 but PyWhois set its expire on 12 july 2022. I would make a PR on https://github.com/richardpenman/whois/blob/master/whois/parser.py but I don't know how I can write this specification :/
Thank :)
darn, that's annoying. If someone sends a PR for this I would merge.
It's possible fix this problem? :-)
Yes regex parsing likely needs to be updated for the im tld
@fundix @Dryusdan if you want to take a crack at this, it may be as simple as setting dayfirst to True:
class WhoisIm(WhoisEntry):
dayfirst = True
... unmodified past here ...
I went to fix this and found that it seems to be working right now:
➜ whois dryusdan.im
(lots of redacted stuff, well, redacted)
Domain Details
Expiry Date: 09/12/2024 00:59:56
Name Server:mail.dryusdan.fr.
Name Server:ns1.first-ns.de.
Name Server:robotns3.second-ns.com.
Name Server:robotns2.second-ns.de.
Name Server:mul.dryusdan.fr.
❯ python3
Python 3.12.3 (main, Apr 9 2024, 08:09:14) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import whois
>>> whois.whois('dryusdan.im')['expiration_date'].strftime("%Y/%m/%d")
'2024/12/09'
Looks like it's been fixed upstream? I made a branch and set dayfirst, but same result.
Nice, thanks for checking. Must have been fixed for a separate issue.