Extract normalised domain names with tldextract
This commit is contained in:
parent
7d4233c9e8
commit
dbe8a5d869
1 changed files with 3 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
|||
import json
|
||||
import tldextract
|
||||
from datetime import datetime, timedelta
|
||||
from typing import Optional, List, Union, Any, Dict
|
||||
|
||||
|
@ -55,7 +56,8 @@ class Origin(AbstractConfiguration):
|
|||
|
||||
@property
|
||||
def normalised_domain_name(self):
|
||||
return self.domain_name.replace("www.", "")
|
||||
extracted_domain = tldextract.extract(self.domain_name)
|
||||
return extracted_domain.registered_domain
|
||||
|
||||
def onion(self) -> Optional[str]:
|
||||
tld = extract(self.domain_name).registered_domain
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue