Ain’t much you can do, police are gonna do what police are gonna do. And you’d be smart to let them do what they are gonna do, or it will go badly for you.
That said, don’t consent. Refuse consent repeatedly and firmly (but politely). Then sue them after. You can’t stop a cop from doing anything on the street, only after in a court of law.