Script to add artwork to podcast

I’m looking for a way to add artwork to podcast files that I download automatically. I’m using Hazel to monitor my iCloud Drive > Downloads folder for audio files that match certain criteria. If those criteria are met, my Mac Mini moves them out the iCloud Drive folder, renames them appropriately, and uses a script to upload them to Overcast. The only part I have not been able to figure out is how to add artwork to the podcast / audio file during the Hazel steps. I do not need to change the audio quality and re-encode it. I would prefer to not do that so that it runs quickly and smoothly.

Because I’m using Hazel, I should be able to use an Automator workflow, a shell script, or Javascript. A shell (bash) script would probably be easiest because that is what I’m already using to rename the file and upload it to Overcast.

Any help would be greatly appreciated.

What file type are your podcast files?

I think for audio files the images are defined in the RSS feed, but there are some multi format containers for chapters etc. that should give other standalone options I guess.

They are MP3 files. There are ways to add artwork to a specific MP3 file with programs but I haven’t found a command line version yet. The one I used on my Windows machine at work is “mp3tag”.

Ok. Try using LAME.

1 Like

Thanks, I looked at LAME but I can’t figure out a way to do it without re-encoding the file. I would rather not have to do that for the sake of time and I’m not sure about the ramifications for quality. For example, when I tried using LAME to add the artwork, which it did, the file size dropped from 134 MB to 89 MB. In the short samples I listened to, I did not notice a difference in quality but I’m nervous about having that happen going forward.

I’ll keep looking but I’ll keep LAME as a backup option.

I haven’t finished updating my script(s) yet but I believe I’m going to make it work with ffmpeg via Homebrew. Once I get it working, I’ll try to write up a synopsis of my steps.