Removing renders from batch groups automation

Hey guys, first time posting here been lurking for a couple years now, I am a newly minted Jr Flame Artist and I’ve been tasked with the fun job of archiving old freelancers machines. My studio does super lite metadata archives and I have a project that had multiple versions, delivered to multiple countries, I’m sure you know how that is. The archive as it stands now is 1TB, we do not cache anything, everything we work on is downloaded onto our machines via dropbox (using Macs). Long story short, i’d love to have some sort of script or method that just removes any media not pointing to a file path. Right now I just sort by file type and any media that does not have a file type is usually flame generated media (in my limited experience). Me and my best friend chatgpt will be working on it but if anyone has advice that would be super helpful.