Skip to content

Instantly share code, notes, and snippets.

View hshrews's full-sized avatar
💥

Heather Shrewsbury hshrews

💥
View GitHub Profile
@hshrews
hshrews / srt_to_txt.py
Last active April 25, 2024 14:25
Python script to convert .srt file to .txt file containing just the text as a data blob.
"""
About:
Looks in the given directory for any .srt (transcript) files to convert to a simple,
single line of text with timestamps and numbered lines removed.
Command line execution:
python srt_to_txt.py <source_directory> <file_encoding>
@:param <source_directory> is the location of the .srt file(s)
@:param <file_encoding> defaults to 'utf-8'