add scripts

Signed-off-by: Martin Matous <m@matous.dev>
This commit is contained in:
Martin Matous 2022-03-28 00:46:25 +02:00
parent c6c66648ea
commit 5a4419bb4e
Signed by: mmatous
GPG key ID: 8BED4CD352953224
12 changed files with 802 additions and 1 deletions

20
flac-convert.py Executable file
View file

@ -0,0 +1,20 @@
#!/usr/bin/env python
import os
import subprocess
import sys
for root, dirs, files in os.walk(sys.argv[1]):
for name in files:
input_name, input_ext = os.path.splitext(name)
l_input_ext = input_ext.lower()
if l_input_ext != '.m4a':
continue
full_name_i = os.path.join(root, name)
full_name_o = os.path.join(root, input_name + '.flac')
process = subprocess.run(['ffmpeg', '-y', '-i', full_name_i, '-compression_level', '12', full_name_o],
check=True,
capture_output=True)
print('deleting ', full_name_i)
print('out ', full_name_o)
os.remove(full_name_i)