Skip to content

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

South Park Clipper

South Park Clipper is a small Python / Flask application with the following features:

  • Import transcripts from SRT files using the spclipper/load_srt.py script. The data is stored in the local sqlite3 spclipper/tokens.db.
  • Search for a word in the transcripts and get an audio file containing the found words.

Pre-requisites

  • 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
    

Installation

  1. cd into the project directory.

  2. Make a virtual environment:

    python3.11 -m venv --prompt spclipper venv
  3. Activate the virtual environment:

    source venv/bin/activate
  4. Install the requirements:

    pip install --ignore-installed -r requirements.txt
  5. Create database

    python spclipper/database_setup.py

Use

Import transcripts

  1. cd into the project directory.

  2. Activate the virtual environment:

    source venv/bin/activate
  3. Run the import script. You can pass more than one SRT file.

    python spclipper/load_srt.py /path/to/a/file.srt

Start Web Server

  1. cd into the project directory.

  2. Activate the virtual environment:

    source venv/bin/activate
  3. Start the web server. Omit --port if you want.

    flask run --host 0.0.0.0 --port 8766

Demo

spclipper-demo.mp4

Errata

  • 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.

About

Import and search SRT transcripts, get an audio file of results

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages