From d1f9e3876facdd9ec1d7fac42c62bd5eaf96652a Mon Sep 17 00:00:00 2001 From: ovosimpatico Date: Mon, 7 Oct 2024 12:49:51 -0300 Subject: [PATCH] Handle channels without a category --- run.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/run.py b/run.py index 5e57b8a..27c861e 100644 --- a/run.py +++ b/run.py @@ -81,7 +81,8 @@ def generate_m3u(): m3u_playlist = "#EXTM3U\n" for channel in livechannelraw: if channel['stream_type'] == 'live': - group_title = categoryname[channel["category_id"]] + # Use a default category name if category_id is None + group_title = categoryname.get(channel["category_id"], "Uncategorized") # Skip this channel if its group is in the unwanted list if not any(unwanted_group.lower() in group_title.lower() for unwanted_group in unwanted_groups): logo_url = channel.get('stream_icon', '')