Skip to content

Commit a172c14

Browse files
committed
1 parent da0bc4a commit a172c14

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/get_domians.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def ads() -> Iterable[str]:
3232
ads = (ad.strip() for ad in ads if ad.strip() != '')
3333
ads = filter(utils.is_not_ip, ads)
3434
ads = filter(utils.is_url, ads)
35+
ads = filter(utils.letter_digit_hyphen, ads)
3536
return sorted(ads)
3637

3738
def v2fly(filename = "category-ir") -> Iterable[str]:

src/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def letter_digit_hyphen(text: str) -> bool:
9999
# https://github.com/v2fly/v2ray-core/discussions/1275
100100
# https://www.rfc-editor.org/rfc/rfc952
101101

102-
return not bool(re.match(r"[^a-zA-Z0-9-.]", text))
102+
return bool(re.search(r"^[a-zA-Z0-9-\.]+$", text))
103103

104104

105105
def download(url: str, path: str, method: str = 'GET', headers: dict = None, payload: str = None):

0 commit comments

Comments
 (0)