User:Angeliki/Feedback Composition
Convert transcriptions to linkable html
import pysrt, argparse
ap = argparse.ArgumentParser("srttojs")
ap.add_argument("srt")
args = ap.parse_args()
srt= pysrt.open(args.srt)
print("<div class='sub'>")
for t in srt:
print ('<div><a data-start="{1}" href="#">{0}</a> {2}</div>'.format(t.start, t.start.ordinal/1000.0, t.text))
print ("</div>")