(host: str)
| 555 | |
| 556 | |
| 557 | def _registrable_domain(host: str) -> Optional[str]: |
| 558 | if not host: |
| 559 | return None |
| 560 | try: |
| 561 | import tldextract |
| 562 | ext = tldextract.extract(host) |
| 563 | if ext.domain and ext.suffix: |
| 564 | return f"{ext.domain}.{ext.suffix}" |
| 565 | return None |
| 566 | except ImportError: |
| 567 | parts = host.rsplit(".", 2) |
| 568 | if len(parts) >= 2: |
| 569 | return ".".join(parts[-2:]) |
| 570 | return host |
| 571 | |
| 572 | |
| 573 | def _query_crtsh(domain: str) -> List[str]: |
no outgoing calls