How to set up domain based routing for YouTube?

I want my WireGuard interface to route only YouTube traffic. Any other traffic including any Google’s services should go through my default gateway.

The issue is that Google has tons of IPs even for a single service like YouTube. Check out this repo where there are thousands of them.

I tried using a Python script to add them all as AllowedIPs but running the interface with wg-quick up just results in freezing, and the interface never runs! I have also tried to add them using sudo ip route add <subnet> dev wg0 but it looks like this can’t bybass AllowedIPs rules as YouTube just stops loading, so the only way here I believe is to route by domain but not sure yet if that’s possible or not.