IPTV Stream Checker is a Python CLI that inspects IPTV M3U/M3U8 playlists, confirms stream availability, captures screenshots, and annotates channels with codec, resolution, and audio metadata. It highlights dead or geoblocked entries, detects mislabeled streams, and can split playlists into working, dead, and geoblocked variants.
The codebase revolves around IPTV_checker.py, which orchestrates playlist parsing, stream validation, media inspection, and reporting. Keep supplemental modules either in the repo root or a utils/ package if single-file maintenance becomes unwieldy. Sample playlists (test_playlist.m3u, MEGAOTT.m3u, DATOO.m3u) support deterministic testing—avoid modifying them in commits. Generated artifacts (renamed playlists, screenshots, split outputs) are emitted alongside the source playlist and should stay untracked.
check_channel_statushandles HTTP checks, follows nested HLS playlists, and validates media segments before optionalffmpegprobes.parse_m3u8_filecoordinates resume logic, status logging, optional splitting/renaming, and screenshot capture.get_stream_info/get_audio_bitratewrapffprobefor codec, resolution, FPS, and audio bitrate details.capture_frameextracts reference images; failures should not abort processing.- Console output uses terminal-width detection for padding and color-coded status glyphs.
python3 -m venv .venv && source .venv/bin/activate: create a virtual environment (Python 3.10+ recommended).pip install -r requirements.txt: installsrequests,ffmpeg-python, andPySocks.python IPTV_checker.py test_playlist.m3u -vv: exercise verbose logging, playlist traversal, and screenshot paths.python IPTV_checker.py --help: verify new CLI switches render correctly after edits.
Use four-space indentation, snake_case for functions, and descriptive constants. Keep logging through logging (INFO/DEBUG) rather than print, except for the ASCII banner. When you introduce CLI flags, supply both short and long forms and document them in README.md.
No automated suite exists; rely on manual validation with the bundled sample and at least one live provider list. Confirm alive/dead/geoblocked tallies, inspect generated playlists, and compare screenshots when visual regressions matter. For proxy flows, run with -proxy-list and -test-geoblock to cover both code paths and capture expected log output in PR notes.
Follow the repo’s pattern of concise, imperative subjects (e.g., “Improve proxy retry jitter”). Keep commits scoped; include body context when touching network timeouts or ffmpeg interactions. Pull requests should link motivating issues, enumerate manual test commands, and mention new CLI options or documentation updates.
Expect directories such as {playlist}_{group}_screenshots/ and logs {playlist}_{group}_checklog.txt for resume support. With -split, the tool writes {playlist}_working.m3u8, {playlist}_dead.m3u8, and geoblocked variants; guard against committing these outputs.
Never commit real playlists, credentials, or proxy lists—use sanitized fixtures. Ensure ffmpeg/ffprobe binaries are installed and callable before enabling screenshot or metadata features. Keep the default User-Agent unless contracts require otherwise, and note any changes in review. Apply subprocess timeouts consistently to avoid hung checks in CI or unattended runs.