This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
''' | |
Simple script to convert ZOOM chat log to SRT subtitle | |
USAGE: conver.py FILE | |
Outputs subtitle data to stdout | |
''' | |
import datetime | |
import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
f = open("chat.txt", "r") | |
prev_time = None | |
subs = [] | |
for x in f: | |
chunks = x.split(' -> '); | |
time = datetime.datetime.strptime(chunks[0], '%H:%M:%S') | |
if prev_time is not None: | |
difference = time - prev_time |