An automated solution for cleaning and validating M3U playlists using FFprobe.
-
Install Docker on your system if not already installed.
-
Pull the Docker image:
docker pull seanriggs/advanced-ffprobe-m3u-cleaner:latest
-
Set up the directory structure:
mkdir m3u-cleaner && cd m3u-cleaner mkdir m3u output logs
-
Place your M3U playlist(s) in the
m3u
directory. -
Create a
docker-compose.yml
file in them3u-cleaner
directory with the following content:version: '3' services: m3u-cleaner: image: seanriggs/advanced-ffprobe-m3u-cleaner:latest volumes: - ./m3u:/app/m3u - ./output:/app/output - ./logs:/var/log
-
Run the cleaner:
docker compose up
-
Find your cleaned playlist in the
output
directory.
Note: Ensure Docker is installed on your system before starting.
- Open Docker Desktop.
- Go to the "Images" tab and search for "seanriggs/advanced-ffprobe-m3u-cleaner".
- Click "Pull" to download the image if not already present.
- Once pulled, click "Run".
- In "Optional settings", add these volume mappings:
- Host path:
C:\path\to\your\m3u-cleaner\m3u
-> Container path:/app/m3u
- Host path:
C:\path\to\your\m3u-cleaner\output
-> Container path:/app/output
- Host path:
C:\path\to\your\m3u-cleaner\logs
-> Container path:/var/log
- Host path:
- Click "Run" to start the container.
Replace C:\path\to\your
with your actual directory path.
- Automated M3U stream validation using FFprobe
- Duplicate entry removal
- Playlist cleaning and organization
During the FFprobe process, this cleaner:
- Checks for valid video and audio streams
- Verifies stream accessibility and playability
- Analyzes stream metadata for format compatibility
What it doesn't do:
- Content analysis or filtering
- Long-term stability monitoring
- Bandwidth or quality checks
M3U_DIRECTORY
: Input M3U files directory (default:/app/m3u
)OUTPUT_FILE
: Cleaned playlist path (default:/app/output/cleaned_playlist.m3u
)LOG_FILE
: Log file path (default:/var/log/validator.log
)
-
Clone the repository:
git clone https://github.com/seanriggs/advanced-ffprobe-m3u-cleaner.git cd advanced-ffprobe-m3u-cleaner
-
For development, use
docker-compose.dev.yml
:docker compose -f docker-compose.dev.yml up --build
-
Make changes to
validator.php
or other files as needed. -
To build and push a new version:
docker build -t seanriggs/advanced-ffprobe-m3u-cleaner:latest . docker push seanriggs/advanced-ffprobe-m3u-cleaner:latest
docker-compose.yml
: Production configurationdocker-compose.dev.yml
: Development configurationDockerfile
: Container image definitionvalidator.php
: Main script for playlist cleaningcomposer.json
: PHP dependencies
For issues or feature requests, please visit our GitHub repository.