metricsubs-segmenter / extract_ass.py
metricv's picture
Initial commit
f953fd7 verified
raw
history blame
304 Bytes
import ass
import os
import sys
if __name__ == "__main__":
filename = sys.argv[1]
with open(filename, "r", encoding='utf-8-sig') as fin:
doc = ass.parse(fin)
for e in doc.events:
if isinstance(e, ass.Dialogue) and e.style == "英":
print(e.text.strip())