mirror of https://github.com/Free-TV/IPTV
Add tvg-chno support using channel number from markdown lists (#1018)
* Add channel number to M3U line formatting 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 * 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 * Delete playlists/playlist_italy.m3u8 delete italy playlist for updating with channel number * Italy playlist updated with channel numbermaster
parent
4462172b34
commit
ea332da787
|
|
@ -103,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:
|
||||
|
|
@ -110,10 +113,11 @@ class Channel:
|
|||
|
||||
def to_m3u_line(self):
|
||||
country = f' tvg-country="{self.country_code}"' if self.country_code else ""
|
||||
chno = f' tvg-chno="{self.chno}"' if self.chno else ""
|
||||
if self.epg is None:
|
||||
return (f'#EXTINF:-1 tvg-name="{self.name}" tvg-logo="{self.logo}"{country} group-title="{self.group}",{self.name}\n{self.url}')
|
||||
return (f'#EXTINF:-1 tvg-name="{self.name}" tvg-logo="{self.logo}"{chno}{country} group-title="{self.group}",{self.name}\n{self.url}')
|
||||
else:
|
||||
return (f'#EXTINF:-1 tvg-name="{self.name}" tvg-logo="{self.logo}" tvg-id="{self.epg}"{country} group-title="{self.group}",{self.name}\n{self.url}')
|
||||
return (f'#EXTINF:-1 tvg-name="{self.name}" tvg-logo="{self.logo}" tvg-id="{self.epg}"{chno}{country} group-title="{self.group}",{self.name}\n{self.url}')
|
||||
|
||||
|
||||
def main():
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue