Skip to content

Commit

Permalink
Add parser support for LS
Browse files Browse the repository at this point in the history
Forgot to add this. Also, fixed a few regex issues with KG and corrected TZ date format
  • Loading branch information
pogzyb committed Nov 4, 2024
1 parent df3a3f7 commit 2d1b70d
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions asyncwhois/tldparsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,13 +392,13 @@ class RegexSU(RegexRU): # same as RU

class RegexKG(TLDParser):
tld_specific_expressions: ExpressionDict = {
TLDBaseKeys.DOMAIN_NAME: r"Domain *(.+) ",
TLDBaseKeys.DOMAIN_NAME: r"Domain *(.+) \(",
TLDBaseKeys.REGISTRAR: r"Domain support: \s*(.+)",
TLDBaseKeys.REGISTRANT_NAME: r"Name: *(.+)",
TLDBaseKeys.REGISTRANT_ADDRESS: r"Address: *(.+)",
TLDBaseKeys.CREATED: r"Record created: *(.+)",
TLDBaseKeys.EXPIRES: r"Record expires on \s*(.+)",
TLDBaseKeys.UPDATED: r"Record last updated on\s*(.+)",
TLDBaseKeys.EXPIRES: r"Record expires on: *(.+)",
TLDBaseKeys.UPDATED: r"Record last updated on: *(.+)",
}

def parse(self, blob: str) -> dict[str, Any]:
Expand Down Expand Up @@ -1404,3 +1404,15 @@ class RegexTZ(TLDParser):
TLDBaseKeys.CREATED: r"registered: *(.+)",
TLDBaseKeys.EXPIRES: r"expire: *(.+)",
}
known_date_formats = ["%d.%m.%Y %H:%M:%S", "%d.%m.%Y"]


class RegexLS(TLDParser):
tld_specific_expressions: ExpressionDict = {
TLDBaseKeys.DOMAIN_NAME: r"domain: *(.+)",
TLDBaseKeys.REGISTRANT_NAME: r"registrant: *(.+)",
TLDBaseKeys.REGISTRAR: r"registrar: *(.+)",
TLDBaseKeys.CREATED: r"registered: *(.+)",
TLDBaseKeys.EXPIRES: r"expire: *(.+)",
}
known_date_formats = ["%d.%m.%Y %H:%M:%S", "%d.%m.%Y"]

0 comments on commit 2d1b70d

Please sign in to comment.