import os
import pprint
import subprocess
def Convert (dir):
curDir = dir
pathToBonk = "C:\\Program Files\\BonkEnc\\becmd.exe"
problemFiles = []
for item in os.listdir(curDir):
if item.upper().endswith('.M4A'):
fullPath = os.path.join(curDir,item)
cmd = '"%s" -e LAME -d "%s" "%s"'
cmd = cmd % (pathToBonk, curDir, fullPath)
val = subprocess.call(cmd)
if val == 0:
os.remove(fullPath)
else:
problemFiles.append(fullPath)
print 'Problem converting %s' % item
os.rename(fullPath, fullPath + ".BAD")
print 'These files had problems converting and have been renamed with .BAD extensions:'
pprint.pprint(problemFiles)
var = raw_input("Insert Path: ")
var.decode("iso-8859-8")
Convert(var)
Hi, I want to reformat my music from .m4a to mp3 songs. I am using the bonkenc command line.
The problem is that some of my folders are in Hebrew. When I use this script in folders that do not contain Hebrew - it works flawlessly. but when there is Hebrew on the way, the script does not work.
I tried coding \ deconding in Hebrew but nothing helped.
I am running windows xps p2. Thanks in advance, Liron.
source
share