- Sanitize the channel number field for embedded double quotes; the
previous fix (#1124) covered group/name/logo/epg but missed
tvg-chno, leaving the same attribute-injection vector open via the
"#" column.
- Add missing "kenya" and "nigeria" entries to COUNTRY_CODES so those
channels get a tvg-country attribute in the generated playlist.
- Sync README.md and flag_order.txt with lists/: add missing flags for
chile, egypt, saudi_arabia, indonesia, kenya, nigeria in their
proper geographic groups.
- Add .gitignore for __pycache__/*.pyc.
group, name, logo and epg values are embedded unescaped into quoted
#EXTINF attributes (tvg-name, tvg-logo, tvg-id, group-title). A value
containing a double quote can break out of its attribute and inject
arbitrary extra attributes/content into the generated playlist.
Strip embedded double quotes from these fields at parse time.
Co-authored-by: KAMI <miholmikor@gmail.com>
* 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 number
Add ISO 3166-1 alpha-2 country codes via tvg-country attribute
to all #EXTINF lines, enabling IPTV players to filter and display
channels by country.
Co-authored-by: Kálmán „KAMI” Szalai <kami911gmail.com>
* Improve make_playlist.py code quality and fix bugs
- Fix group name bug: replace underscores with spaces before title()
so filenames like north_korea.md produce "North Korea" not "North_Korea"
- Fix resource leaks: use context managers for all file handles including
EPG list and per-country playlist files
- Remove os.chdir() global side effect: use absolute paths derived from
the script location instead
- Avoid calling to_m3u_line() twice per channel by caching the result
- Fix redundant trailing colon in filename[:-3:] slice
- Consistent use of write() for headers instead of mixing print/write
- Strip blank lines from EPG URL list when reading
* Skip commit and push when playlist has no changes
Prevents the workflow from failing with exit code 1 when the generated
playlist is identical to the previous run and there is nothing to commit.
* Use current branch instead of hardcoded master for push
Replace hardcoded origin/master reference with @{u} (upstream of current
branch) for the diff check, and use HEAD for the push target so the
workflow works correctly on any branch.
---------
Co-authored-by: Kálmán „KAMI” Szalai <kami911gmail.com>
I removed the try/except block in the __init__ method. Instead, I split the md_line string into a list of parts and extract the relevant information from the list. If the list has more than 6 elements, then it means that the epg value is present, otherwise it is set to None.
I added a main function to contain the code that reads the input files and generates the output playlist.
I made minor formatting changes, such as adding blank lines between the different sections of the code, and using parentheses to enclose the arguments in the print statements. These changes are not strictly necessary, but they can make the code easier to read and understand.
I've added "encoding='utf-8'" in line 25 and line 30 because on Windows the original script return some error (UnicodeEncodeError: 'charmap' codec can't encode character).