Merge pull request #125 from thsrite/main
This commit is contained in:
commit
ce62355197
@ -158,7 +158,6 @@ class CloudflareSpeedTest(_PluginBase):
|
||||
else:
|
||||
# 替换优选ip
|
||||
err_hosts = customHosts.get("err_hosts")
|
||||
enable = customHosts.get("enable")
|
||||
|
||||
# 处理ip
|
||||
new_hosts = []
|
||||
@ -166,16 +165,16 @@ class CloudflareSpeedTest(_PluginBase):
|
||||
if host and host != '\n':
|
||||
host_arr = str(host).split()
|
||||
if host_arr[0] == self._cf_ip:
|
||||
new_hosts.append(host.replace(self._cf_ip, best_ip))
|
||||
new_hosts.append(host.replace(self._cf_ip, best_ip).replace("\n", "") + "\n")
|
||||
else:
|
||||
new_hosts.append(host)
|
||||
new_hosts.append(host.replace("\n", "") + "\n")
|
||||
|
||||
# 更新自定义Hosts
|
||||
self.update_config(
|
||||
{
|
||||
"hosts": new_hosts,
|
||||
"hosts": ''.join(new_hosts),
|
||||
"err_hosts": err_hosts,
|
||||
"enable": enable
|
||||
"enabled": True
|
||||
}, "CustomHosts"
|
||||
)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user