Both methods are easy. It's then a case of using FFmpeg with an -activation_bytes parameter to convert to MP3 or whatever (or just remux into an M4A/M4B without transcoding). Tutorial here:
There are a bunch of other tools (both commercial and free) which use the above techniques but add either a nice CLI or GUI. The original was Inaudible itself, which can be found on your favourite torrenting site. Alternatively you can grab it from here, but I'm not sure how up-to-date it is: