Need an automation to filter a podcast by length

Is there any easy-ish way to take a podcast RSS feed and only return the items where the audio is less than x length?

I have some podcasts that are advertised as “5 minutes each day”, but they toss in 30 to 90 minute episodes at random intervals. I’d like to just filter those out so I’m not even bothered by them.

It looks like I have a couple of RSS fields I could work with:

<enclosure length=5656944 type=audio/mpeg url=myfile.mp3 />

so I could use the duration for any podcasts that supported it, or the enclosure length for ones that didn’t. The premise, hopefully, being that even with variable length a 5 minute file is going to be much smaller than an hour-long file. :smiley:

I suppose I could do this in PHP, but kind of hoping there might be an easier way.