write out srt files for each language too

This commit is contained in:
j 2017-10-04 11:04:19 +00:00
parent baf6625bde
commit 708b27bdb1

View file

@ -234,6 +234,7 @@ if __name__ == '__main__':
files = opts.files files = opts.files
if not files: if not files:
files = glob(os.path.join(opts.prefix, 'output/*/*.json')) files = glob(os.path.join(opts.prefix, 'output/*/*.json'))
files = [f for f in files if not 'gong' in f]
for item_json in files: for item_json in files:
prefix = 'public/' + item_json.split('/')[-1][0].lower() + item_json.split('/')[-2] + '.' prefix = 'public/' + item_json.split('/')[-1][0].lower() + item_json.split('/')[-2] + '.'
prefix = os.path.join(opts.prefix, prefix) prefix = os.path.join(opts.prefix, prefix)
@ -245,4 +246,5 @@ if __name__ == '__main__':
render_subtitles(item_json, output_json, output_srt, ['no', 'en']) render_subtitles(item_json, output_json, output_srt, ['no', 'en'])
for lang in ('en', 'ko', 'no'): for lang in ('en', 'ko', 'no'):
output_json = prefix + lang + '.json' output_json = prefix + lang + '.json'
render_subtitles(item_json, output_json, None, lang) output_srt = prefix + lang + '.srt'
render_subtitles(item_json, output_json, output_srt, lang)