dmulholl / mp3cat

A command line utility for joining MP3 files.
https://www.dmulholl.com/dev/mp3cat.html
The Unlicense
185 stars 22 forks source link

output.mp3 in the input dir #14

Closed niXta1 closed 5 years ago

niXta1 commented 5 years ago

I find this really useful for my audiobooks! I hate having tons of chapters in separate files. It would be even better if you could let the output.mp3 be placed in the same folder as the input .mp3's.

Another thing I would like is to be able to batch run it over all my folders only combining mp3 if they are in the same folder and then go to the next. This can, of course, be made with a bash script and call mp3cat but it would be nice to have it built in.

dmulholl commented 5 years ago

Glad you're finding it useful :) Reassembling audiobooks is exactly the use case I originally built it for myself!

There's no restriction on where the output file is placed; it can certainly be inside the same folder as the input files. Are you getting an error message when attempting this?

As for batch running, I think this is a better use case for something like shell scripting as you mention. I'm a big fan of simple tools that do one job as simply and elegantly as possible. It's always tempting to keep adding features but the end result is usually a mess.

The real problem is that every new feature has to be documented and longer documentation increases the mental burden for every person who ever uses the tool, regardless of whether they need that feature or not. Tools keep accumulating features and complexity until eventually someone comes along and builds a simpler tool that just does the core job of the old one and the process begins all over again...

niXta1 commented 5 years ago

Allright! I get it; do you even bash, bro? Problem is that my bash-fu and regex-fu is seriously lacking, and 5min of work for anyone who knows anything is probably 5h of work for me. Could we have a few scripting examples in the wiki?

As you can see here I barely know what I'm doing ^^: mp3cat -t -d ./; find . -name 'output.mp3' -exec bash -xc 'dir1=$(basename "$PWD" "{}"); dir2=${dir1//_/ }; dir3=${dir2//./ }; dir4=${dir3//-/ - }; dir5=${dir4// - / - }; dir6=${dir5%%\ - AUDIOBOOK*}; dir7=${dir6%%\ Audiobook*}; dir8=${dir7%%\ - MP3*}; dir9=${dir8%%\ - [0-9][0-9]CD*}; dir10=${dir9%%\ - [0-9]CD*}; fn=${dir10%% SWEDISH*}; mv output.mp3 "$fn.save"; rm *.mp3; rm *.m3u; rm *.sfv; mv "$fn.save" "$fn.mp3"; mv *.jp*g album.jpg; cp Folder.jp*g album.jpg; ' \;

ohadschn commented 5 years ago

@niXta1 regarding scripting samples, you can check out my script here: https://github.com/ohadschn/Merge-ZippedMix/blob/master/Merge-ZippedMix.ps1

Note that it's PowerShell (not bash), but I warmly suggest you try it - it's cross-plat these days.