There may be better ways than this, but an possibility would be to let the client load Youtube (or Youku) in an iFrame and then read the contents of it, if you can't get the page or you can catch some error, then you should get Youku.
That does also mean that when Youtube is down for maintenance for example your script would break.
IP routing may be better, but as far as I know there is not a perfect script for it.
You may want to check this: How do you detect a website visitors country