mirror of
https://github.com/mvt-project/mvt.git
synced 2024-06-30 16:18:54 +00:00
Merge branch 'main' of github.com:mvt-project/mvt
This commit is contained in:
commit
a440d12377
|
@ -4,6 +4,7 @@
|
||||||
# https://license.mvt.re/1.1/
|
# https://license.mvt.re/1.1/
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
from typing import Optional
|
||||||
from tld import get_tld
|
from tld import get_tld
|
||||||
|
|
||||||
SHORTENER_DOMAINS = [
|
SHORTENER_DOMAINS = [
|
||||||
|
@ -308,7 +309,7 @@ class URL:
|
||||||
|
|
||||||
return self.is_shortened
|
return self.is_shortened
|
||||||
|
|
||||||
def unshorten(self) -> None:
|
def unshorten(self) -> Optional[str]:
|
||||||
"""Unshorten the URL by requesting an HTTP HEAD response."""
|
"""Unshorten the URL by requesting an HTTP HEAD response."""
|
||||||
res = requests.head(self.url)
|
res = requests.head(self.url)
|
||||||
if str(res.status_code).startswith("30"):
|
if str(res.status_code).startswith("30"):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user