Archangel
A flexible, extendable content filter
... complex, intensive blocking. I have already written a module that does content-based blocking of youtube videos.
Archangel uses the pyicap library to implement the ICAP functionality. The blockpage requires use of the PHP 5.4.x CLI. In order to do HTTPS filtering, you must first install squid compiled with SSL support and configure it to talk to archangel.