diff options
author | morpheus65535 <[email protected]> | 2022-03-14 19:42:38 -0400 |
---|---|---|
committer | morpheus65535 <[email protected]> | 2022-03-14 19:42:38 -0400 |
commit | 6edc196163061ae233324bacbf918886159f4efb (patch) | |
tree | 2800d225bae2c3decc0c084f067d80edbae92357 | |
parent | b73c7866e0e59b3b73cab7ac5304167200a3dafd (diff) | |
download | bazarr-6edc196163061ae233324bacbf918886159f4efb.tar.gz bazarr-6edc196163061ae233324bacbf918886159f4efb.zip |
Fixed Invalid IPv6 URL exception with common fix
-rw-r--r-- | libs/tld/utils.py | 16 | ||||
-rw-r--r-- | libs/version.txt | 2 |
2 files changed, 15 insertions, 3 deletions
diff --git a/libs/tld/utils.py b/libs/tld/utils.py index f26de2a6d..763cd5fc8 100644 --- a/libs/tld/utils.py +++ b/libs/tld/utils.py @@ -310,12 +310,24 @@ def process_url( url = f"https://{url}" # Get parsed URL as we might need it later - parsed_url = urlsplit(url) + try: + parsed_url = urlsplit(url) + except ValueError as e: + if fail_silently: + parsed_url = url + else: + raise e else: parsed_url = url # Get (sub) domain name - domain_name = parsed_url.hostname + try: + domain_name = parsed_url.hostname + except AttributeError as e: + if fail_silently: + domain_name = None + else: + raise e if not domain_name: if fail_silently: diff --git a/libs/version.txt b/libs/version.txt index d82f63262..d851fc78e 100644 --- a/libs/version.txt +++ b/libs/version.txt @@ -127,7 +127,7 @@ webencodings==0.5.1 backports.functools-lru-cache==1.6.4 fcache==0.4.7 json_tricks==3.15.5 -tld==0.12.6 +tld==0.12.6 # https://github.com/barseghyanartur/tld/pull/119 # Required-by: requests certifi==2021.10.8 |