From 86d11c8187f8e5c8ef877f5b959e4aac875da8fa Mon Sep 17 00:00:00 2001 From: Giacinto Lo Meo Date: Tue, 7 Apr 2026 22:41:26 +0200 Subject: [PATCH] Update make_playlist.py Add tvg-chno support using channel number from markdown lists - Extract channel number from md lists - Add tvg-chno attribute to M3U output - Skip invalid values (e.g. 0) Improves channel ordering in IPTV clients like Jellyfin --- make_playlist.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/make_playlist.py b/make_playlist.py index dc227dc..143655c 100755 --- a/make_playlist.py +++ b/make_playlist.py @@ -93,7 +93,6 @@ COUNTRY_CODES = { class Channel: def __init__(self, group, md_line, country_code=""): - self.chno = self.number if self.number and self.number != "0" else None self.group = group self.country_code = country_code md_line = md_line.strip() @@ -104,6 +103,9 @@ class Channel: self.url = self.url[self.url.find("(")+1:self.url.rfind(")")] self.logo = parts[4].strip() self.logo = self.logo[self.logo.find('src="')+5:self.logo.rfind('"')] + + self.chno = self.number if self.number and self.number != "0" else None + if len(parts) > 6: self.epg = parts[5].strip() else: