update subtitles

This commit is contained in:
j 2017-05-17 10:15:28 +00:00
parent a407dfd1b5
commit 8e8348cca3
2 changed files with 10 additions and 1 deletions

View file

@ -35,6 +35,7 @@ def is_new(xml, mp4):
return vtime < xtime
def encode(xml, force=False):
item_json = xml.relace('.xml', '.json')
audio_xml = xml.replace('.xml', '.audio.xml')
vocals_xml = xml.replace('.xml', '.vocals.xml')
mp4 = xml.replace('.xml', '.mp4')
@ -121,6 +122,10 @@ def encode(xml, force=False):
subprocess.call(cmd)
shutil.move(mp4, public_mp4)
shutil.move(mp4_480p, public_mp4_480p)
cms = [
'./subtitles.py', item_json
]
subprocess.call(cmd)
def encode_all():
for xml in sorted(glob('output/*/*.xml')):

View file

@ -97,7 +97,11 @@ if __name__ == '__main__':
with open('subtitles.json', 'w') as fd:
json.dump(items, fd, indent=4, ensure_ascii=False)
for item_json in glob('output/*/*.json'):
if len(sys.argv) > 1:
files = sys.argv[1:]
else:
files = glob('output/*/*.json')
for item_json in files:
prefix = 'public/' + item_json.split('/')[-1][0].lower() + item_json.split('/')[-2] + '.1080p.'
output_json = prefix + 'json'
output_srt = prefix + 'srt'