Skip to content

Instantly share code, notes, and snippets.

@whoizit

whoizit/srt2txt Secret

Last active March 25, 2020 17:06
Show Gist options
  • Save whoizit/c54f916c1c6d78ad5ac88cf4735c9d7d to your computer and use it in GitHub Desktop.
Save whoizit/c54f916c1c6d78ad5ac88cf4735c9d7d to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
from sys import argv
import pysrt
subs = pysrt.open(argv[1])
with open(argv[1] + '.txt', 'w') as f:
for x in range(len(subs)):
f.write(subs[x].text + '\n')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment