Once you brought it up about making sure the socket was closed, I thought that was it. Added in sockclose, and still no response after socket has been opened.
I even copy pasted your posted code. Still no response. Yours doesn't respond and all (but you don't have an echo for the sockopen).
I'm stumped. I might try this on a blank script file to see. Maybe I have another part of my script conflicting with it.
Edit: Trying it on a blank script still no response. I added in an echo just after
sockopen -e ytube www.googleapis.com 443
and it will respond with that, but none of the other echos respond.
I've tried with my playlist ID and API key plugged in, and also with your exact script copy/pasted. No change at all. Is there some kind of configuration or plugin I am supposed to have installed or set somewhere?