<?php
$poster = null;
$list = [
"https://i.ytimg.com/vi/".$video_id."/hqdefault.jpg",
"https://i.ytimg.com/vi/".$video_id."/maxresdefault.jpg"
];
foreach ( $list as $url ) {
$headers = get_headers($url, true);
if ( !empty($headers[0]) && preg_match('#200|302#', $headers[0]) ) {
$poster = $url;
break;
}
}
var_dump($poster);
foreach($result->items as $item) {
echo 'ID: '.$item->id->videoId.'<br><br>
TITLE: '.$item->snippet->title.'<br><br>
DESC: '.$item->snippet->description.'<br><br>
<img width=120 height=90 src='.$item->snippet->thumbnails->default->url.'><br><br>
<img width=320 height=180 src='.$item->snippet->thumbnails->medium->url.'><br><br>
<img width=480 height=360 src='.$item->snippet->thumbnails->high->url.'><br><br>
<iframe width=600 height=500 src=https://www.youtube.com/embed/'.$item->id->videoId.'?feature=oembed frameborder=0 allowfullscreen></iframe><br><br>';
}
RewriteCond %{QUERY_STRING} (^|&)blog($|&)
RewriteCond %{QUERY_STRING} (^|&)page\=([0-9]{1,})($|&)
RewriteRule .............................. [L,R=301]