diff --git a/generate-test-data.py b/generate-test-data.py index 02c9513..c22f1f2 100644 --- a/generate-test-data.py +++ b/generate-test-data.py @@ -6,11 +6,13 @@ from config import Config def generate_test_file(fn, delta): - subprocess.call(['ffmpeg', - '-f', 'lavfi', - '-i', 'sine=frequency=1000:duration=%d' % delta.total_seconds(), - '-b:a', '%dk' % Config.KBITS, - fn]) + subprocess.call([ + 'ffmpeg', + '-f', 'lavfi', + '-i', 'sine=frequency=1000:duration=%d' % delta.total_seconds(), + '-b:a', '%dk' % Config.KBITS, + fn + ]) start = datetime.now().replace(minute=0, second=0) - timedelta(hours=3) diff --git a/prolefeeder.py b/prolefeeder.py index e4f2e08..bd11054 100644 --- a/prolefeeder.py +++ b/prolefeeder.py @@ -110,14 +110,15 @@ def prepare_download(form): output_filename = os.path.basename(output_filename) attachment_filename = '{}_{}.mp3'.format(form.start_time.data, form.length.data) - c = ['ffmpeg', '-y'] - c += ['-ss', str(ss)] - c += ['-i', 'concat:' + '|'.join( - [os.path.join(app.config['DATA_DIR'], s['fn']) for s in sources])] - c += ['-codec', 'copy'] - c += ['-t', str(form.length.data * 60)] - c += [os.path.join(app.config['TMP_DIR'], output_filename)] - + c = [ + 'ffmpeg', '-y', + '-ss', str(ss), + '-i', 'concat:' + '|'.join( + [os.path.join(app.config['DATA_DIR'], s['fn']) for s in sources]), + '-codec', 'copy', + '-t', str(form.length.data * 60), + os.path.join(app.config['TMP_DIR'], output_filename) + ] app.logger.debug(' '.join(c)) subprocess.call(c)