How Free-TV/IPTV Handles Different Channel Source Groups: ATSC, Pluto TV, and Beyond
TLDR: The make_playlist.py script treats all channels uniformly under country-level groups, ignoring source-specific categories like ATSC or Pluto TV defined in <h2> tags to generate consistent M3U playlists.
The Free-TV/IPTV repository transforms markdown-based channel lists into aggregated M3U playlists for media players. Understanding how it handles different channel source groups reveals why over-the-air ATSC channels, streaming Pluto TV channels, and satellite sources all receive identical group-title attributes in the final output.
Country-Level Grouping from Markdown Filenames
The script derives the primary grouping key from the filename of each markdown file in the lists/ directory. It strips the .md extension and converts the remaining text into a title-cased group name.
country_key = filename[:-3] # e.g., "usa"
group = country_key.replace("_", " ").title() # → "Usa"
This derived group is applied to every channel extracted from that file. When the Channel.to_m3u_line method generates the M3U output, it inserts this value into the group-title attribute for all entries, ensuring geographic consistency across the playlist.
H1 Header Overrides for Custom Group Names
While parsing markdown files, the script checks for an <h1> tag to override the filename-derived group. This logic appears in lines 51-53 of make_playlist.py.
if "<h1>" in line.lower() and "</h1>" in line.lower():
group = re.sub('<[^<>]+>', '', line.strip())
If present, the text inside the <h1> tags replaces the default country group. This provides flexibility for maintainers to define custom group names without renaming the underlying files.
Why ATSC and Pluto TV Source Groups Are Ignored
Despite markdown files containing secondary headings like <h2>ATSC</h2> or <h2>Pluto</h2>—visible in files like lists/usa.md—the script does not process <h2> tags. The parser only evaluates <h1> headers for group overrides, meaning every channel regardless of source type inherits the same country-level group.
For example, both an ATSC channel and a Pluto TV channel from lists/usa.md receive group-title="Usa":
#EXTINF:-1 tvg-name="Buzzr Ⓖ" tvg-logo="https://upload.wikimedia.org/wikipedia/commons/thumb/d/d6/Buzzr_logo.svg/768px-Buzzr_logo.svg.png" tvg-chno="1" tvg-country="US" group-title="Usa",Buzzr Ⓖ
https://buzzrota-ono.amagi.tv/playlist1080.m3u8
#EXTINF:-1 tvg-name="BBC Food" tvg-logo="https://i.imgur.com/N3xiz4m.png" tvg-chno="1" tvg-country="US" group-title="Usa",BBC Food
https://service-stitcher.clusters.pluto.tv/v1/stitch/embed/hls/channel/5fb5844bf5514d0007945bda/master.m3u8
This uniform treatment simplifies playlist management but collapses source-specific distinctions in the final M3U output.
Channel Extraction and M3U Generation
The script identifies valid channels by scanning for lines containing the [>] marker. Each match creates a Channel object (defined in lines 14-21) that extracts the channel number, name, URL, logo, and optional EPG ID.
The generator produces two output types:
playlist.m3u8– A master playlist containing all channels from all countries.playlists/playlist_<country>.m3u8– Per-country playlists (e.g.,playlist_usa.m3u8).
Running the generator executes as follows:
$ python3 make_playlist.py
Generating Usa
Generating United Arab Emirates
…
Every channel entry follows the same format regardless of whether it originates from ATSC, Pluto TV, or other sources, maintaining the country-level grouping established at parse time.
Summary
- Filename-based grouping: The script derives
group-titlefrom markdown filenames (e.g.,usa.md→ "Usa"). - H1 override support: Only
<h1>tags can override the default group;<h2>tags are ignored. - Uniform source handling: ATSC, Pluto TV, and other source categories defined in
<h2>headers receive no special treatment in the M3U output. - Dual output: The generator creates both a global playlist and individual country-specific playlists in the
playlists/directory.
Frequently Asked Questions
Does the script create separate playlists for ATSC and Pluto TV channels?
No. The script does not differentiate between channel source groups. All channels from a given markdown file receive the same group-title attribute based on the filename or <h1> header, regardless of whether they are listed under ATSC, Pluto TV, or other <h2> sections in the source markdown.
How can I change the group-title for specific channels?
You can override the default country group by adding an <h1> tag at the top of the markdown file. The script extracts the text from this tag (lines 51-53) and applies it to all subsequent channels in that file. Individual channels cannot have unique group titles under the current implementation.
What markers are used to identify valid channels in the markdown files?
The parser looks for lines containing the [>] marker to identify channel entries. Each line with this marker is converted into a Channel object that generates the corresponding #EXTINF line in the M3U output.
Where are the generated M3U playlists saved?
The script outputs playlist.m3u8 in the root directory containing all channels, and individual files like playlists/playlist_usa.m3u8 for each country. These paths are generated at runtime based on the country keys extracted from the filenames in the lists/ directory.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →