From 9d6bb3b32331492be184375d1f4a37e0d31f53e7 Mon Sep 17 00:00:00 2001 From: thsrite Date: Sun, 6 Aug 2023 22:42:20 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix=20=E6=A0=A1=E6=AD=A3cf=E4=BC=98?= =?UTF-8?q?=E9=80=89ip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/plugins/cloudflarespeedtest/__init__.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/plugins/cloudflarespeedtest/__init__.py b/app/plugins/cloudflarespeedtest/__init__.py index fe11f290..e22eca36 100644 --- a/app/plugins/cloudflarespeedtest/__init__.py +++ b/app/plugins/cloudflarespeedtest/__init__.py @@ -133,10 +133,9 @@ class CloudflareSpeedTest(_PluginBase): hosts = customHosts.get("hosts") if isinstance(hosts, str): hosts = str(hosts).split('\n') - # 校正优选ip if self._check: - self.__check_cf_if(hosts=hosts) + self.__check_cf_ip(hosts=hosts) # 开始优选 if err_flag: @@ -204,7 +203,7 @@ class CloudflareSpeedTest(_PluginBase): self.__update_config() self.stop_service() - def __check_cf_if(self, hosts): + def __check_cf_ip(self, hosts): """ 校正cf优选ip 防止特殊情况下cf优选ip和自定义hosts插件中ip不一致 @@ -212,11 +211,12 @@ class CloudflareSpeedTest(_PluginBase): # 统计每个IP地址出现的次数 ip_count = {} for host in hosts: - ip = host.split()[0] - if ip in ip_count: - ip_count[ip] += 1 - else: - ip_count[ip] = 1 + if host: + ip = host.split()[0] + if ip in ip_count: + ip_count[ip] += 1 + else: + ip_count[ip] = 1 # 找出出现次数最多的IP地址 max_ips = [] # 保存最多出现的IP地址 From f57344593472717dbf47881c17d483d03f8fb5b0 Mon Sep 17 00:00:00 2001 From: thsrite Date: Sun, 6 Aug 2023 22:42:45 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix=20=E6=97=B6=E9=97=B4=E6=AF=94=E8=BE=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/plugins/mediasyncdel/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/plugins/mediasyncdel/__init__.py b/app/plugins/mediasyncdel/__init__.py index 6e5215b5..d8922e28 100644 --- a/app/plugins/mediasyncdel/__init__.py +++ b/app/plugins/mediasyncdel/__init__.py @@ -577,7 +577,7 @@ class MediaSyncDel(_PluginBase): for match in matches: mtime = match[0] # 排除已处理的媒体信息 - if last_time and time < last_time: + if last_time and mtime < last_time: continue mtype = match[1]