If you want the exact match for url links that you specified in your urls.txt, this should do it:
Code:
on *:TEXT:*:#: {
  var %x = $lines(urls.txt)
  while (%x) {
    if ($read(urls.txt,%x) isin $1-) {
      ban -k # $nick 2 $v1 is forbidden to advertise!
    }
    dec %x
  }
}