How mmguero/cleanvid works
cleanvid is a command-line tool that identifies profanity in subtitles and produces muted video or subtitle-based alternatives. Its main workflow acquires subtitles, filters and rewrites matching entries, then uses FFmpeg to mute the corresponding audio intervals and remultiplex the result. It also supports subtitle-only output, MPlayer EDL, JSON, PlexAutoSkip, and optional subtitle embedding. The workflow and these capabilities are documented in the README; the sampled implementation excerpt is partial, so some internal links rely on that documentation.
Main entry points: cleanvid.py CLI workflow · swears.txt Profanity rules · caselessdictionary.py Case-insensitive map
Components 18
Subtitle input
- CLI workflow
src/cleanvid/cleanvid.py - Subtitle extraction
src/cleanvid/cleanvid.py - Subtitle download
src/cleanvid/cleanvid.py - SRT input
- Subtitle libraries
Profanity filtering
- SRT parsing
src/cleanvid/cleanvid.py - Profanity rules
src/cleanvid/swears.txt - Case-insensitive map
src/cleanvid/caselessdictionary.py - Filtered segments
src/cleanvid/cleanvid.py
Clean outputs
- Clean subtitles
src/cleanvid/cleanvid.py - MPlayer EDL
src/cleanvid/cleanvid.py - JSON outputs
src/cleanvid/cleanvid.py - PlexAutoSkip data
src/cleanvid/cleanvid.py
Media processing
- Mute intervals
src/cleanvid/cleanvid.py - FFmpeg
- Video input
- Clean video
src/cleanvid/cleanvid.py
Other components
- User
Connections 22
- User → CLI workflow: provides inputs
README.md - CLI workflow → Subtitle extraction: extracts subtitles
README.md - CLI workflow → Subtitle download: downloads subtitles
README.md - CLI workflow → SRT input: accepts subtitles
README.md - Subtitle extraction → Video input: reads embedded tracks
README.md - Subtitle extraction → FFmpeg: extracts tracks
README.md - Subtitle download → Subtitle libraries: uses subliminal
README.md - CLI workflow → SRT parsing: processes subtitles
README.md - SRT parsing → Subtitle libraries: parses with pysrt
README.md - SRT parsing → Profanity rules: checks phrases
README.md - SRT parsing → Case-insensitive map: uses mapping
src/cleanvid/cleanvid.py - SRT parsing → Filtered segments: selects matches
README.md - Filtered segments → Clean subtitles: writes subtitles
README.md - CLI workflow → MPlayer EDL: generates EDL
README.md - CLI workflow → JSON outputs: generates JSON
README.md - CLI workflow → PlexAutoSkip data: generates Plex data
README.md - CLI workflow → Mute intervals: builds mute intervals
README.md - CLI workflow → FFmpeg: invokes processing
README.md - FFmpeg → Video input: reads video
README.md - Mute intervals → FFmpeg: specifies mute timing
README.md - FFmpeg → Clean video: creates remuxed video
README.md - Clean subtitles → Clean video: embeds optionally
README.md