A Python utility that converts M3U playlists into STRM files for use with media servers like Jellyfin, Plex, or Kodi.
M3U2STRM takes your M3U playlist and:
- Categorizes content into series, movies, and live TV
- Creates STRM files that point to media streams
- Organizes content in a folder structure compatible with media servers
- Updates only when content changes
- Sends notifications when new content is available
- ✅ Converts M3U streams to organized STRM files
- 📁 Categorizes content intelligently (series, movies, live TV)
- 📺 Creates proper TV series structure with seasons and episodes
- 🎬 Organizes movies with year information when available
- 📡 Generates a clean live.m3u file for direct use
- 🔄 Checks for content changes and updates efficiently
- 📱 Sends Telegram notifications for new content
- 🌐 Web UI for browsing and selecting content
- 🐳 Docker support for easy deployment
- 🔄 Optional Jellyfin library refresh integration
# 1. Clone the repository
git clone https://github.com/yourusername/m3u2strm.git
cd m3u2strm
# 2. Edit docker-compose.yml with your settings
# 3. Run with Docker Compose
docker-compose up -d# 1. Clone the repository
git clone https://github.com/yourusername/m3u2strm.git
cd m3u2strm
# 2. Install requirements
pip install -r requirements.txt
# 3. Run the application
python task.py| Variable | Description | Example |
|---|---|---|
M3U_URL |
URL to download M3U playlist | http://provider.com/playlist.m3u |
M3U_FILE |
Path to local M3U file (alternative to URL) | /path/to/playlist.m3u |
These settings define which M3U groups contain which type of content:
| Variable | Description | Example |
|---|---|---|
SERIES_GROUPS |
Groups containing TV series | SERIES,DIZILER,TV_SHOWS |
MOVIES_GROUPS |
Groups containing movies | MOVIES,FILMLER,FILMS |
LIVE_GROUPS |
Groups containing live TV | LIVE,TV,CHANNELS |
| Variable | Description | Default |
|---|---|---|
TASK_INTERVAL |
Minutes between updates | 5 |
WEB_UI_PORT |
Port for the web interface | 8475 |
DEBUG_LOGGING |
Enable verbose logging | false |
| Variable | Description | Example |
|---|---|---|
TELEGRAM_BOT_TOKEN |
Telegram bot API token | 123456789:ABCdefGhIjKlmnOpQrsTUVwxyz |
TELEGRAM_CHAT_ID |
Telegram chat to receive notifications | 12345678 |
JELLYFIN_URL |
Jellyfin server URL | http://192.168.1.100:8096 |
JELLYFIN_API_KEY |
Jellyfin API key | 32character_api_key_from_jellyfin |
Access the web UI at http://your-server-ip:8475 to:
- Browse all content from your M3U playlist
- Select specific series, movies, and channels to include
- Search for specific titles
- Save your selections for STRM generation
vods/
├── series/
│ └── Show Name/
│ └── Season 01/
│ └── Show Name S01E01.strm
├── movies/
│ └── Movie Name (2023)/
│ └── Movie Name (2023).strm
└── live.m3u
- Series: Detected by patterns like "S01 E01" or "1x01" in titles
- Movies: Identified by group and optionally by year in parentheses
- Live TV: All streams in configured live groups
#EXTM3U
#EXTINF:-1 tvg-id="series1" tvg-name="Breaking Bad S01 E01" group-title="SERIES",Breaking Bad S01 E01
http://example.com/series/breaking_bad_s01e01.mp4
#EXTINF:-1 tvg-id="movie1" tvg-name="Inception (2010)" group-title="MOVIES",Inception (2010)
http://example.com/movies/inception.mp4
#EXTINF:-1 tvg-id="live1" tvg-name="CNN" group-title="LIVE",CNN HD
http://example.com/live/cnn.m3u8
- Adding IPTV to Jellyfin/Plex/Kodi: Convert streams to structured libraries
- Organizing VOD Content: Sort series and movies automatically
- Managing Live TV: Create a single file for all channels
- Content Selection: Use the web UI to pick which content to include
- No content appearing? Check your group settings and filters in the web UI
- Series not detected? Ensure titles follow "S01 E01" or "1x01" naming patterns
- Docker issues? Verify volume mappings and environment variables
For more detailed examples and a sample M3U file, see example.m3u included in the repository.
This project is licensed under the MIT License - see the LICENSE file for details.
