South Park Clipper is a small Python / Flask application with the following features:
- Import transcripts from SRT files using the
spclipper/load_srt.pyscript. The data is stored in the local sqlite3spclipper/tokens.db. - Search for a word in the transcripts and get an audio file containing the found words.
-
Tested with Python 3.11
-
You have some audio files in one of the formats supported by libsndfile.
-
You have some SRT files containing transcripts of those audio files.
-
The audio files and the SRT files are in the same directory.
-
Each pair of files (audio and SRT) have the same file name, except for the extension. For example:
South.Park.S01E01.srt South.Park.S01E01.mp3 South.Park.S01E02.srt South.Park.S01E02.mp3
-
cdinto the project directory. -
Make a virtual environment:
python3.11 -m venv --prompt spclipper venv
-
Activate the virtual environment:
source venv/bin/activate -
Install the requirements:
pip install --ignore-installed -r requirements.txt
-
Create database
python spclipper/database_setup.py
-
cdinto the project directory. -
Activate the virtual environment:
source venv/bin/activate -
Run the import script. You can pass more than one SRT file.
python spclipper/load_srt.py /path/to/a/file.srt
-
cdinto the project directory. -
Activate the virtual environment:
source venv/bin/activate -
Start the web server. Omit
--portif you want.flask run --host 0.0.0.0 --port 8766
spclipper-demo.mp4
- Audio clips are stored in the static/audio directory. You are responsible for cleaning them out periodically, etc.
- Each clip has a unique file name including a time stamp.
- No attempt is made to avoid creating duplicate clips.