Skip to content

Commit

Permalink
Handle channels without a category
Browse files Browse the repository at this point in the history
  • Loading branch information
ovosimpatico committed Oct 7, 2024
1 parent 6a561e6 commit d1f9e38
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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', '')
Expand Down

0 comments on commit d1f9e38

Please sign in to comment.