Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #653

Merged
merged 3 commits into from
Dec 11, 2024
Merged

fix #653

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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