Please have a look at https://hu.wikipedia.org/wiki/Szerkeszt%C5%91:BinBot/piroskat-userallap.py
Unfortunately, not all comments are in English, sorry for that.
def redCategories 
shows how an HTML source can be downloaded and processed for red category links. "(megíratlan szócikk)" after the title within brackets means "unwritten article", I don't know the English phrase. "piros" in comments means red and "kék" means blue.