Skip to content

Instantly share code, notes, and snippets.

View aliciaduffy's full-sized avatar

Alicia Duffy aliciaduffy

View GitHub Profile
@adammw
adammw / tt2srt.py
Created April 12, 2011 09:44
Timed Text Captions to SRT Subtitles converter script
# Usage: python tt2srt.py source.xml output.srt
from xml.dom.minidom import parse
import sys
i=1
dom = parse(sys.argv[1])
out = open(sys.argv[2], 'w')
body = dom.getElementsByTagName("body")[0]
paras = body.getElementsByTagName("p")
for para in paras: