First of you are kind of doing "reverse engineering":
You are trying to understand how YouTube works and then "adapt" it to your needs.
IF you will get that to work it could for a short period of time. Services like YouTube are actively changed to improve it.
On the other hand the method that YouTube uses to function will most likely be used by many other programs (so blocking them too!).
What you could do (not sure if that is possible in pfsense) is use the hostname [youtube.com] (or even use an IP range) to restrict that in amount of data used or speed or whatever.
Does YouTube stream Videos via TCP? – DavidPostill – 2015-12-26T15:06:29.713
Via TCP as well as UDP and any port used for same? – Nullpointer – 2015-12-26T15:08:12.193
Read all the answers – DavidPostill – 2015-12-26T15:09:26.087
@Devid I Read all comment, then how to restrict bandwidth on pfsense firewall? – Nullpointer – 2015-12-26T15:12:59.537
YouTube already limits its own bandwidth usage. If you do this, your videos will freeze, or suffer a loss of quality. – Michael Hampton – 2015-12-26T15:17:12.757
@MichaelHampton I need to restrict bandwidth in my own network because any one open the youtube with HD video, at that time freeze the whole network :)\ – Nullpointer – 2015-12-30T05:56:23.253
out of interest, what device are you using to run pfsense? – barlop – 2016-01-12T06:01:14.557