No offence, but it isnt sorted Callum.
It definatly still needs the url encode plus the youtube one doesnt even encode the space.
Not trying to bog you down or anything but I just wanted to say....
Search Hawkee for somthing like a URL encode alias or just url encode and then pop that in the script and use the alias around your search parameters (ie $$2-)