Content only looks for text within the first 10 packets or 2 KB of a connection. If that text does not exist within that connection, it does not match.
Matching a URL via layer7 doesn’t necessarily work the way you want it to as it will match ANY connection with that content, so for example, it would match this forum page. Also layer7 won’t match HTTPS sessions since all content is encrypted.
The better solutions would be to block all IP addresses associated with youtube, but you also then run the risk of blocking more than what you intended. Another option would be to force the use of DNS servers that you control and have a static entry for the domains you do not want to allow that point to a bogus IP.