A small amount of dark or brownish mucus around 17 weeks is often just old blood making its way out. I had a similar scare and my doctor said it's usually nothing to worry about if there's no pain or foul smell. It can happen after sex or even just from the cervix being sensitive. If it gets heavier, smells bad or you have cramps, it's always safest to call your doctor.