Skip to content

Commit

Permalink
Merge pull request #652 from Guovin/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Guovin authored Dec 11, 2024
2 parents 2d5c9d7 + 2662a3d commit 7349493
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions updates/multicast/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 2 additions & 3 deletions utils/speed.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)
Expand Down

0 comments on commit 7349493

Please sign in to comment.