castdrian / OSAC

The Open Source Audible Converter
GNU General Public License v2.0
74 stars 18 forks source link

Multiple files in one go #13

Open Macbethis opened 5 years ago

Macbethis commented 5 years ago

This is a great thing.. I'm just wondering is it possible to expand the project to allow for selecting multiple .aax files and converting as a batch?

that would make life much easier... don't you think?

kind regards,

thw0rted commented 4 years ago

I haven't had time to look at how to implement this in the GUI, but I did come up with a workaround. I ran the GUI once and copied the console output to get my activation_bytes. Then, I downloaded the ffmpeg binary from this repo and made a batch file that points at it:

c:\portable\ffmpeg.exe -y -activation_bytes XXXYYY -i %1 -ab 62k -map_metadata 0 -id3v2_version 3 -vn "d:\converted\%~n1.m4b"

I hard-coded the output path and bitrate; note that %~n1 is the filename of the first argument minus the extension.

Then, I made a second file to call the first one:

@echo off

REM Always run from BAT's working dir 
cd /d %~dp0

for %%f in (%*) DO (
start /low "Transcoding %%~nf" _audible_worker.bat %%f
)

Now, I can drag a bunch of files onto the second batch file in Windows Explorer, and it opens one new window per file so I can transcode them in parallel. It's a good-enough solution as long as you only have one Audible account so your activation_bytes value doesn't change.