5

Simple Python Script for Extracting Text from an SRT File

 1 year ago
source link: https://gist.github.com/ndunn219/62263ce1fb59fda08656be7369ce329b
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Instantly share code, notes, and snippets.

Simple Python Script for Extracting Text from an SRT File

Author

ndunn219 commented on Apr 6, 2017

I wrote this to create readable/printable text files to follow along with El ministerio del tiempo in Spanish. The SRT files are available at https://www.opensubtitles.org/es/ssearch/sublanguageid-spa/idmovie-192528

thanks for the help, there is problem as you open file with file_encoding but don't save with it it will cause error

Thanks. It works perfectly!

Hi.I cannot seem to get this to work. There are no error generated, but it doesn't output the formatted file.

run your code like:
python srt_to_txt.py file_name.srt cp1252

run your code like:
python srt_to_txt.py file_name.srt cp1252

Thank you so much for this clarifying comment!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK