UTIs from Masturbation

So over the past 6 months, I haven’t been able to masturbate without getting a UTI. I know it’s this because the burning always starts a few days after. I’ve had about 4 and I don’t know what to do. I’ve asked my doctor and followed all cleanliness procedures, taken the antibiotics, peed afterwards, and even started taking cranberry supplements for my PH. At this point i’ve even stopped masturbating but it’s so frustrating to not know what’s wrong. Has anyone else experienced this or know what to do?