From 478fe3d16465a9598248eabc5f494bb1a8fae694 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Thu, 17 Aug 2023 07:06:19 +0800 Subject: [PATCH] fix get_url_domain --- app/utils/string.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/utils/string.py b/app/utils/string.py index f4b866f4..a6d31dde 100644 --- a/app/utils/string.py +++ b/app/utils/string.py @@ -242,7 +242,10 @@ class StringUtils: return 'u2.dmhy.org' _, netloc = StringUtils.get_url_netloc(url) if netloc: - return ".".join(netloc.split(".")[-2:]) + locs = netloc.split(".") + if len(locs) > 3: + return netloc + return ".".join(locs[-2:]) return "" @staticmethod