Handle channels without a category
Some checks failed
Build and Push Docker Image / build-and-push (push) Has been cancelled

This commit is contained in:
ovosimpatico
2024-10-07 12:49:51 -03:00
parent 6a561e69ba
commit d1f9e3876f

3
run.py
View File

@@ -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', '')