From 5486f6868e8a9f8789fd0909e39b8353e3f35bd5 Mon Sep 17 00:00:00 2001 From: j Date: Thu, 10 Aug 2017 14:56:11 +0200 Subject: [PATCH] print less --- edit.py | 9 +++++---- ffmpeg.py | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/edit.py b/edit.py index ec31b5e..492ff15 100755 --- a/edit.py +++ b/edit.py @@ -43,17 +43,18 @@ def sort_clips(clips, sort): if __name__ == '__main__': import sys edit_id = sys.argv[1] + if len(sys.argv) > 2: + sort_by = sys.argv[2] + else: + sort_by = 'year' api = ox.API(base_url + '/api/') api.signin(**credentials) edit = api.getEdit(id=edit_id)['data'] - with open('%s_info.json' % normalize(edit_id), 'w') as fd: - json.dump(edit, fd, indent=4, ensure_ascii=False) - videos = [] subtitles = [] position = 0 - for clip in sort_clips(edit['clips'], 'year'): + for clip in sort_clips(edit['clips'], sort_by): part_pos = 0 for i, duration in enumerate(clip['durations']): diff --git a/ffmpeg.py b/ffmpeg.py index 3fa8978..3075ad7 100755 --- a/ffmpeg.py +++ b/ffmpeg.py @@ -54,6 +54,7 @@ for clip in edit: ] cmd = [ 'ffmpeg', + '-nostats', '-loglevel', 'error', '-ss', str(clip['in']), '-i', clip['path'] ] + options + [