This project provides a Docker container that converts IPTV VOD content from an M3U playlist into .strm
files, which can be imported into media servers like Plex, Emby, or Jellyfin. The container runs continuously, updating content every hour.
- Continuous Operation: Runs indefinitely, checking for new content every hour
- Automatic Cleanup: Removes
.strm
files for content no longer in the playlist - Smart Parsing: Handles M3U files with proper EXTINF parsing
- Media Server Compatible: Creates
.strm
files compatible with Plex, Emby, and Jellyfin - Organized Structure:
- Movies:
/media/movies/Movie Name/Movie Name.strm
- TV Shows:
/media/tv shows/Series Name/Season 01/Series Name S01E01.strm
- Movies:
- Error Handling: Robust error handling with logging and retry mechanisms
- Health Monitoring: Built-in health checks for container monitoring
- Docker installed on your system
- An M3U playlist URL containing IPTV VOD content
- Writable storage for the media volume
-
Build the Docker image:
docker build -t m3u2strm .
-
Run the container:
docker run -d \ --name m3u2strm \ -e urlm3u="YOUR_M3U_PLAYLIST_URL" \ -v /path/to/your/media:/media \ --restart unless-stopped \ m3u2strm
-
Check the logs:
docker logs m3u2strm
urlm3u
(required): The URL of your M3U playlist
/media
: Mount point for your media files/media/movies
: Contains movie.strm
files/media/tv shows
: Contains TV show.strm
files
docker run -d \
--name m3u2strm \
-e urlm3u="http://example.com/playlist.m3u" \
-v /home/user/media:/media \
m3u2strm
version: '3.8'
services:
m3u2strm:
build: .
container_name: m3u2strm
environment:
- urlm3u=http://example.com/playlist.m3u
volumes:
- /home/user/media:/media
restart: unless-stopped
- Add
/path/to/your/media/movies
as a Movie library - Add
/path/to/your/media/tv shows
as a TV Show library - Ensure Plex has read access to the mounted volume
- Add the media folders in your server settings
- Configure the libraries to scan for new content automatically
The container creates the following structure:
/media/
├── movies/
│ └── Movie Name/
│ └── Movie Name.strm
└── tv shows/
└── Series Name/
└── Season 01/
└── Series Name S01E01.strm
- Download: Downloads the M3U playlist from the provided URL
- Parse: Parses EXTINF entries to extract metadata (title, group, season/episode info)
- Filter: Filters for video files (mp4, mkv, avi, m4v)
- Categorize: Determines if content is a movie or TV show based on URL patterns and metadata
- Create: Creates appropriate directory structure and
.strm
files - Cleanup: Removes orphaned files that are no longer in the playlist
- Repeat: Waits 1 hour and repeats the process
The parser handles standard M3U format with EXTINF entries:
#EXTINF:-1 tvg-name="Movie Name" group-title="Movies",Movie Name
http://example.com/movies/movie.mp4
#EXTINF:-1 tvg-name="Series Name S01E01" group-title="TV Series",Series Name S01E01
http://example.com/series/episode.mkv
Logs are written to /app/logs/process.log
inside the container. To access logs:
# View live logs
docker logs -f m3u2strm
# Access log file directly
docker exec m3u2strm cat /app/logs/process.log
- Container stops immediately: Check that the
urlm3u
environment variable is set - No files created: Verify the M3U URL is accessible and contains VOD content
- Permission denied: Ensure the mounted volume has write permissions
- Files not showing in media server: Check that the media server has read access to the volume
The container includes a health check that verifies the log file exists:
docker health m3u2strm
To run the container interactively for debugging:
docker run -it \
-e urlm3u="YOUR_M3U_PLAYLIST_URL" \
-v /path/to/your/media:/media \
m3u2strm
- Update Frequency: The container checks for updates every hour by default
- Storage: Each
.strm
file is very small (just contains a URL) - Network: Downloads the M3U file once per hour
- CPU: Minimal CPU usage during processing
- The container runs as root by default for directory creation
- URLs in
.strm
files are stored in plain text - Consider using a reverse proxy if your M3U URL contains sensitive information
This project is licensed under the MIT License. See the LICENSE
file for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
For issues and questions:
- Check the logs for error messages
- Verify your M3U URL is accessible
- Ensure proper volume permissions
- Create an issue with relevant logs and configuration