Skip to content

Commit

Permalink
bugFix:修复错误
Browse files Browse the repository at this point in the history
  • Loading branch information
sinspired committed Nov 9, 2024
1 parent 487018e commit d2f4edf
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 15 deletions.
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
*.egg-info
*.pyc
.pybuild
*.spec
__pycache__
build
dist
*test*.*
.idea/

# https://github.com/phusion/debian-packaging-for-the-modern-developer/blob/master/.gitignore
debhelper-build-stamp
.DS_Store
.debhelper
*.deb
*.dsc
*.build
*.buildinfo
*.changes
*.tar.gz
*.log
*.substvars
*.csv
.vagrant
30 changes: 15 additions & 15 deletions SetHosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,8 @@ def write_to_hosts_file(self, new_entries: List[str]):

rprint("\n[bold yellow]正在更新hosts文件...[/bold yellow]")
for entry in new_entries:
new_content.append(f"{entry} #mkhosts")
# new_content.append(f"{entry} #mkhosts")
new_content.append(f"{entry}")
rprint(f"添加条目:{entry}")

new_content.append(f"")
Expand Down Expand Up @@ -347,7 +348,7 @@ async def update_hosts(self):
# 3. 将最快的IP应用到组内所有域名
rprint(f"\n为组内所有域名应用发现的最快IP:")
for domain in group.domains:
new_entries = [f"{ip} {domain}" for ip, latency in fastest_ips]
new_entries = [f"{ip}\t{domain}" for ip, latency in fastest_ips]
rprint(f" {domain}:")
# for entry in new_entries:
# rprint(f" {entry}")
Expand Down Expand Up @@ -466,24 +467,23 @@ async def update_hosts(self):
ips={
"216.239.32.40",
"2404:6800:4008:c15::94",
"35.197.239.137",
"2a00:1450:4001:829::201a",
"2404:6800:4008:c13::5a",
"35.186.181.189",
"35.189.113.240",
"35.228.168.221",
"2a00:1450:4001:803::201a",
"35.210.233.33",
"74.125.204.139",
"2607:f8b0:4004:c07::66",
"2607:f8b0:4004:c07::71",
"2607:f8b0:4004:c07::8a",
"2607:f8b0:4004:c07::8b",
"172.253.62.100",
"172.253.62.101",
"172.253.62.102",
"172.253.62.103",

"2607:f8b0:4004:c07::71",
"2607:f8b0:4004:c07::8a",
"2607:f8b0:4004:c07::8b",
"172.253.62.100",
"172.253.62.101",
"172.253.62.102",
"172.253.62.103",
# "35.197.239.137",
# "35.186.181.189",
# "35.189.113.240",
# "35.228.168.221",
# "35.210.233.33",
},
),
DomainGroup(
Expand Down
Binary file modified dist/SetHosts.exe
Binary file not shown.

0 comments on commit d2f4edf

Please sign in to comment.