-
-
Save patrick91/37d0eb7e7e1303eb314a313107196d9b to your computer and use it in GitHub Desktop.
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 sys | |
import glob | |
def add_line(filename): | |
out = [] | |
with open(filename) as f: | |
for l in f: | |
if '-->' in l: | |
out.append('{} line:90%\n'.format(l.rstrip())) | |
else: | |
out.append(l) | |
return ''.join(out) | |
files = glob.glob('*.vtt') | |
for f in files: | |
edited = add_line(f) | |
with open(f, 'w') as n: | |
n.write(edited) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment