I have some php code that fetches a youtube link and then gets its thumbnail. For that I am using this:
$str = file_get_contents(youtubelink);
They are probably blocking you. They have an API to use, https://developers.google.com/youtube/v3/.