refactor: extract extract_domain function

This commit is contained in:
Vlad Stan 2023-02-15 10:33:56 +02:00
parent 3648dc212c
commit 1c81ca300f
3 changed files with 42 additions and 8 deletions

View file

@ -1,3 +1,5 @@
from urllib.parse import urlparse
from bech32 import bech32_decode, convertbits
@ -17,3 +19,6 @@ def normalize_public_key(pubkey: str) -> str:
raise ValueError("Public Key is not valid hex")
int(pubkey, 16)
return pubkey
def extract_domain(url: str) -> str:
return urlparse(url).netloc