Possibly use urlparse library which could detect the type of the url and white/blacklist certain url types? For example something like a file:// url would pass at the moment, but be invalid.