From 8a9eb6e120963ea37ac23ef911bbe02a95b67651 Mon Sep 17 00:00:00 2001 From: "guorong.zheng" <360996299@qq.com> Date: Wed, 11 Dec 2024 17:36:17 +0800 Subject: [PATCH 1/2] chore:var --- updates/multicast/request.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/updates/multicast/request.py b/updates/multicast/request.py index aad5644b1f..67e6e6a6e1 100644 --- a/updates/multicast/request.py +++ b/updates/multicast/request.py @@ -48,8 +48,7 @@ async def get_channels_by_multicast(names, callback=None): "rb", ) as file: cache = pickle.load(file) or {} - multicast_data = cache.get("multicast", {}) - channels = {key: value for key, value in multicast_data.items() if key in names} + channels = {key: value for key, value in cache.get("multicast", {}).items() if key in names} except: pass if config.open_request: From 2662a3de711ccaba0f97c05de5a01e88412af70b Mon Sep 17 00:00:00 2001 From: "guorong.zheng" <360996299@qq.com> Date: Wed, 11 Dec 2024 18:06:13 +0800 Subject: [PATCH 2/2] fix:result url cache info --- utils/speed.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/utils/speed.py b/utils/speed.py index 409a3f5a67..341889c3db 100644 --- a/utils/speed.py +++ b/utils/speed.py @@ -249,7 +249,7 @@ def sort_urls_by_speed_and_resolution(name, data, logger=None): filter_data = [] for url, date, resolution, origin in data: result = { - "url": url, + "url": remove_cache_info(url), "date": date, "delay": None, "speed": None, @@ -267,11 +267,10 @@ def sort_urls_by_speed_and_resolution(name, data, logger=None): speed, delay, cache_resolution = cache_item['speed'], cache_item['delay'], cache_item['resolution'] resolution = cache_resolution or resolution if speed is not None: - url = remove_cache_info(url) try: if logger: logger.info( - f"Name: {name}, URL: {url}, Date: {date}, Delay: {delay} ms, Speed: {speed:.2f} M/s, Resolution: {resolution}" + f"Name: {name}, URL: {result["url"]}, Date: {date}, Delay: {delay} ms, Speed: {speed:.2f} M/s, Resolution: {resolution}" ) except Exception as e: print(e)