Youtube api YouTube API出现间歇性错误:未捕获异常“Google_IO_exception”,消息为“无法解析主机”www.googleapis.com

Youtube api YouTube API出现间歇性错误:未捕获异常“Google_IO_exception”,消息为“无法解析主机”www.googleapis.com,youtube-api,Youtube Api,我在尝试使用YouTube API检索播放列表和视频信息时遇到间歇性错误。我正在使用PHP客户端。以下是全部错误: PHP Fatal error: Uncaught exception 'Google_IO_Exception' with message 'Couldn't resolve host 'www.googleapis.com'' in /Test/libs/google-api-php-client-master/src/Google/IO/Curl.php:115 Stack

我在尝试使用YouTube API检索播放列表和视频信息时遇到间歇性错误。我正在使用PHP客户端。以下是全部错误:

PHP Fatal error:  Uncaught exception 'Google_IO_Exception' with message 'Couldn't resolve host 'www.googleapis.com'' in /Test/libs/google-api-php-client-master/src/Google/IO/Curl.php:115
Stack trace:
#0 /Test/libs/google-api-php-client-master/src/Google/IO/Abstract.php(136): Google_IO_Curl->executeRequest(Object(Google_Http_Request))
#1 /Test/libs/google-api-php-client-master/src/Google/Http/REST.php(60): Google_IO_Abstract->makeRequest(Object(Google_Http_Request))
#2 [internal function]: Google_Http_REST::doExecute(Object(Google_Client), Object(Google_Http_Request))
#3 /Test/libs/google-api-php-client-master/src/Google/Task/Runner.php(174): call_user_func_array(Array, Array)
#4 /Test/libs/google-api-php-client-master/src/Google/Http/REST.php(46): Google_Task_Runner->run()
#5 /Test/libs/google-api-php-client-master/src/Google/Client.php(590): Google_Http_REST::execute(Object(Google_Client), Object(Google_Http_Request))
#6 /Test/libs/google-api-php-client-master/src/Google/Service/Resource.php(228): Google_Client->execute(Objec in /Test/libs/google-api-php-client-master/src/Google/IO/Curl.php on line 115
另外,这是我的代码:

$client = new Google_Client();
$client->setDeveloperKey("*****************");

$service = new Google_Service_YouTube($client);
$results = $service->playlists->listPlaylists("snippet", array("channelId" => "UCkyQHj9ceKEVZR2qO0LUUdg", "maxResults" => 50));
$results = $service->playlistItems->listPlaylistItems("snippet", array("playlistId" => "PL2Kceei6lZdpFRvkRyQMStS0UknLE3mKV", "maxResults" => 50));
错误是不一致的。这种情况并非总是发生。当它出现时(通常情况下),我必须刷新浏览器几次,然后它才能工作

有人遇到过这种情况吗