Skip to content

M3U Sorter: Organize Your IPTV Playlists with Ease

The M3U Sorter Tool is a Python utility designed to streamline IPTV playlist management. This tool processes .m3u and .m3u8 files, alphabetically organizes channel entries based on their names, and generates a clean, sorted playlist. Perfect for improving playlist readability and simplifying navigation in your IPTV player.

Whether you manage personal or shared playlists, the M3U Sorter Tool ensures your playlists remain organized and user-friendly.

GitHub Repository: IPTV-M3U-Sort-File

Overview

Title: Alphabetize Your IPTV Playlists with the M3U Sorter Tool
Description: A Python-based tool to organize and sort IPTV playlists alphabetically, generating clean, user-friendly .m3u files for better streaming management.
Tags: IPTV, M3U, Python, Playlist Management

Key Features

  • Alphabetical Sorting: Automatically organizes playlist entries by channel names
  • Multiple Formats: Supports .m3u and .m3u8 playlist files
  • Clean Output: Generates sorted playlists in a clear and standardized format
  • Error Handling: Validates file existence and ensures proper input processing
  • Customizable Naming: Saves output files with a prefixed sorted_ for easy identification

Installation/Setup

Step 1: Clone the Repository

git clone https://github.com/your-repository/M3U-Sorter.git
cd M3U-Sorter

Step 2: Install Python Dependencies Ensure you have Python 3 installed. Install any required packages using pip:

pip install -r requirements.txt

Step 3: Prepare Your Playlist File Place your .m3u or .m3u8 file in the same directory as the script.

Usage Guide

Run the Script Execute the script to sort your playlist file:

python sort_m3u.py

You'll be prompted to enter the name of your .m3u file. The script will process the file and generate a new one, sorted alphabetically:

Enter the input file name (with or without extension): playlist
Sorted M3U file created: sorted_playlist.m3u

Example Input/Output

Input Playlist: playlist.m3u

#EXTM3U
#EXTINF:-1,Channel B
http://example.com/streamB
#EXTINF:-1,Channel A
http://example.com/streamA

Output Playlist: sorted_playlist.m3u

#EXTM3U
#EXTINF:-1,Channel A
http://example.com/streamA
#EXTINF:-1,Channel B
http://example.com/streamB

Additional Information

Options - Custom File Names: You can specify playlist files with or without extensions, and the tool will adapt accordingly - Preserve File Format: The tool respects the .m3u or .m3u8 extension of the input file when generating the output

Requirements - Python 3.6+

Organize your IPTV playlists in seconds with the M3U Sorter Tool. Simplify navigation, declutter your player, and enjoy a seamless streaming experience. Try it today! 🚀