add scripts
Signed-off-by: Martin Matous <m@matous.dev>
This commit is contained in:
parent
c6c66648ea
commit
5a4419bb4e
12 changed files with 802 additions and 1 deletions
20
flac-convert.py
Executable file
20
flac-convert.py
Executable 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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue