https://github.com/samestrin/m3uclean
A robust tool designed to validate and clean M3U playlists by verifying each channel's stream availability and removing any entries with invalid streams.
https://github.com/samestrin/m3uclean
Last synced: 9 months ago
JSON representation
A robust tool designed to validate and clean M3U playlists by verifying each channel's stream availability and removing any entries with invalid streams.
- Host: GitHub
- URL: https://github.com/samestrin/m3uclean
- Owner: samestrin
- License: mit
- Created: 2025-03-11T19:43:04.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-11T20:11:21.000Z (over 1 year ago)
- Last Synced: 2025-03-11T20:34:06.777Z (over 1 year ago)
- Language: Python
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# m3uclean
[](https://github.com/samestrin/m3uclean/stargazers) [](https://github.com/samestrin/m3uclean/network/members) [](https://github.com/samestrin/m3uclean/watchers)
 [ ](https://opensource.org/licenses/MIT)[](https://www.python.org/)
A robust tool designed to validate and clean M3U playlists by verifying each channel's stream availability and removing any entries with invalid streams.
## Features
* **Stream Validation**: Automatically checks each channel's stream availability
* **Rate Limiting Protection**: Smart handling of rate limits with automatic backoff
* **Slow Mode**: Conservative request rates for more reliable validation
* **Cleaning**: Cleans and corrects malformed entries
* **Aggressive Cleaning**: Removes potentially dangerous characters completely
* **Duplicate Removal**: Identifies and removes duplicate channel entries
* **Logging**: Detailed logs of actions performed on the playlists
* **Docker Integration**: Packaged into a Docker container for easy deployment
## Installation
### Using pip
```bash
pip install m3uclean
```
### From source
```bash
git clone https://github.com/samestrin/m3uclean.git
cd m3uclean
pip install -e .
```
### Using Docker
```bash
docker pull samestrin/m3uclean
```
Or build the Docker image yourself:
```bash
git clone https://github.com/samestrin/m3uclean.git
cd m3uclean
docker build -t m3uclean .
```
## Usage
### Command Line
```bash
# Basic usage
m3uclean input.m3u -o output.m3u
# With stream validation
m3uclean input.m3u -o output.m3u -v
# With stream validation in slow mode (recommended for large playlists)
m3uclean input.m3u -o output.m3u -v --slow
# With aggressive cleaning
m3uclean input.m3u -o output.m3u -a
# With custom log file
m3uclean input.m3u -o output.m3u -l logfile.log
# Full options
m3uclean input.m3u -o output.m3u -l logfile.log -v -a --slow
```
### Using Docker
```bash
docker run -it --rm \
-e INPUT_FILE="/var/tmp/m3u/playlist.m3u" \
-e OUTPUT_FILE="/var/tmp/m3u/playlist_clean.m3u" \
-e LOG_FILE="/var/tmp/m3u/m3uclean.log" \
-e STREAM_VALIDATE="true" \
-e AGGRESSIVE_CLEAN="true" \
-v "/path/to/your/local/m3ufiles:/var/tmp/m3u" \
m3uclean
```
## Environment Variables
When using Docker, you can configure the application using the following environment variables:
* `INPUT_FILE`: Path to the input M3U playlist file
* `OUTPUT_FILE`: Path to the output M3U playlist file
* `LOG_FILE`: Path to the log file
* `STREAM_VALIDATE`: Set to "true" to enable stream validation
* `AGGRESSIVE_CLEAN`: Set to "true" to enable aggressive cleaning
## Contribute
Contributions to this project are welcome. Please fork the repository and submit a pull request with your changes or improvements.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Share
[](https://twitter.com/intent/tweet?text=Check%20out%20this%20awesome%20project!&url=https://github.com/samestrin/m3uclean) [](https://www.facebook.com/sharer/sharer.php?u=https://github.com/samestrin/m3uclean) [](https://www.linkedin.com/sharing/share-offsite/?url=https://github.com/samestrin/m3uclean)