sort_keys=True
This commit is contained in:
parent
26a90dfd6e
commit
3b10328e65
1 changed files with 2 additions and 2 deletions
|
@ -116,7 +116,7 @@ def render_subtitles(item_json, output_json, output_srt, lang=None):
|
||||||
with open(output_srt, 'wb') as fd:
|
with open(output_srt, 'wb') as fd:
|
||||||
fd.write(ox.srt.encode(subtitles))
|
fd.write(ox.srt.encode(subtitles))
|
||||||
with open(output_json, 'w') as fd:
|
with open(output_json, 'w') as fd:
|
||||||
json.dump(subtitles, fd, indent=4, ensure_ascii=False)
|
json.dump(subtitles, fd, indent=4, ensure_ascii=False, sort_keys=True)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
@ -125,7 +125,7 @@ if __name__ == '__main__':
|
||||||
else:
|
else:
|
||||||
items = update_subtitles()
|
items = update_subtitles()
|
||||||
with open('subtitles.json', 'w') as fd:
|
with open('subtitles.json', 'w') as fd:
|
||||||
json.dump(items, fd, indent=4, ensure_ascii=False)
|
json.dump(items, fd, indent=4, ensure_ascii=False, sort_keys=True)
|
||||||
|
|
||||||
if len(sys.argv) > 1:
|
if len(sys.argv) > 1:
|
||||||
files = sys.argv[1:]
|
files = sys.argv[1:]
|
||||||
|
|
Loading…
Reference in a new issue