Skip to content

Commit

Permalink
typo fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
wzdnzd committed Jul 30, 2024
1 parent eca799e commit fc773e4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions subscribe/location.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def rename(proxy: dict, reader: database.Reader) -> dict:
if country == "中国":
# TODO: may be a transit node, need to further confirm landing ip address
text = re.sub(r"^[\U0001F1E6-\U0001F1FF]{2}", "", name, flags=re.I).strip()
name = re.sub(r"(\d+|(\d+)?(-\d+)?[A-Z])$", "", text, flags=re.I).strip()
name = re.sub(r"-?(\d+|(\d+|\s+|(\d+)?-\d+)[A-Z])$", "", text, flags=re.I).strip()
if not name:
name = country
elif country:
Expand Down Expand Up @@ -174,7 +174,7 @@ def regularize(

records = defaultdict(list)
for proxy in proxies:
name = re.sub(r"(\d+|(\d+)?(-\d+)?[A-Z])$", "", proxy.get("name", "")).strip()
name = re.sub(r"-?(\d+|(\d+|\s+|(\d+)?-\d+)[A-Z])$", "", proxy.get("name", "")).strip()
if not name:
name = "未知地域"

Expand Down
2 changes: 1 addition & 1 deletion subscribe/scripts/gitforks.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def github_warp(ghproxy: str, url: str) -> str:
masks = utils.multi_thread_run(func=crawl.is_available, tasks=tasks)

# filter available subscriptions
effective_subs = [candidates[i] for i in range(len(masks)) if masks[i]]
effective_subs = sorted([candidates[i] for i in range(len(masks)) if masks[i]])
logger.info(f"[GithubFork] collect task finished, found {len(effective_subs)} subscriptions")

# save result
Expand Down
2 changes: 1 addition & 1 deletion tools/clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def main(args: argparse.Namespace) -> None:
except Exception:
pass

name = re.sub(r"(\d+|(\d+)?(-\d+)?[A-Z])$", "", item.get("name", "")).strip()
name = re.sub(r"-?(\d+|(\d+|\s+|(\d+)?-\d+)[A-Z])$", "", item.get("name", "")).strip()
if not name:
name = "".join(random.sample(string.ascii_uppercase, 6))

Expand Down

0 comments on commit fc773e4

Please sign in to comment.