I'm trying to make a call from PHP to the YouTube API v3 to get the duration of a video. I've got my developer key, and have assembled what seems to be a valid URL, based on Google's docs and many other posts on SO:
https://www.googleapis.com/youtube/v3/videos?id=rpVJkH7dWsY&part=contentDetails&key={myDeveloperKey}
I can enter this url into a browser, and a correct hunk of stuff comes back. But when I call it from PHP via file_get_contents($the_url)
, it fails with a "Connection timed out" error.
I must be doing something wrong; any advice? Thanks!