This commit is contained in:
jxxghp
2024-04-19 12:31:38 +08:00
parent 148984ad0e
commit 0679a32659
5 changed files with 15 additions and 13 deletions

View File

@ -13,6 +13,12 @@ import dateutil.parser
from app.schemas.types import MediaType
_special_domains = [
'u2.dmhy.org',
'pt.ecust.pp.ua',
]
class StringUtils:
@staticmethod
@ -257,8 +263,9 @@ class StringUtils:
"""
if not url:
return ""
if 'u2.dmhy.org' in url:
return 'u2.dmhy.org'
for domain in _special_domains:
if domain in url:
return domain
_, netloc = StringUtils.get_url_netloc(url)
if netloc:
locs = netloc.split(".")