ErrorException [ Warning ]: file_get_contents(https://www.googleapis.com/youtube/v3/videos?part=statistics&id=y2CaG6VjABQ&key=AIzaSyDq_fWQi0q3ncvtm6-3aMNC0QHSY-WXwK4): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden

/var/www/urgan.rf/project/content/VideoByHeadingView.php [ 71 ]

66               if ($video->getCode()) {
67                 $matches = array();
68                 preg_match('/d\/(\w+)(\"\s|\?)/', $video->getCode(), $matches);
69                 if (isset($matches[1])) {
70                   $video_ID = $matches[1];
71                   $JSON = file_get_contents("https://www.googleapis.com/youtube/v3/videos?part=statistics&id={$video_ID}&key=AIzaSyDq_fWQi0q3ncvtm6-3aMNC0QHSY-WXwK4");
72                   $JSON_Data = json_decode($JSON);
73                   $youtube_viewscount = $JSON_Data->items[0]->statistics->viewCount;
74                 }
75               }
76               ?>
  1. {PHP internal call} » ngin::engineErrorHandler(arguments)

  2. /var/www/urgan.rf/project/content/VideoByHeadingView.php [ 71 ] » file_get_contents(arguments)

  3. /var/www/urgan.rf/engine/class/SMenu.php [ 539 ] » VideoByHeadingView->run()

  4. /var/www/urgan.rf/layout/pages/main.php [ 3 ] » SMenu->echoContent()

  5. /var/www/urgan.rf/layout/switch.php [ 35 ] » include(arguments)

  6. /var/www/urgan.rf/main_template.php [ 188 ] » require_once(arguments)

  7. /var/www/urgan.rf/start.php [ 18 ] » include(arguments)

  8. /var/www/urgan.rf/map.php [ 75 ] » include(arguments)

Environment