File size: 2.58Kb
<?php
include 'includes/func.php';
include 'includes/info.php';
if($_GET['q'])
{
$q = $_GET['q'];
}
$title ='Download Video '.$q.' | tube.mp3lk.com';
echo '<meta name="description" content="Free Download Video '.$q.' .3gp .mp3 .avi .mkv HD For Free from your phone PC,Phone,Gadget,Laptop | Download Video Gratis '.$q.' [.3GP - .MP4] Dengan mudah dan cepat dari ponsel anda hanya di Tubelk.com" />';
include 'includes/config.php';
if(!empty($_GET['q']))
{
echo '<div class="phdr">Search Result '.$q.'</div>';
}
$qu=$q;
$qu=str_replace(" ","+", $qu);
$qu=str_replace("-","+", $qu);
$qu=str_replace("_","+", $qu);
if(strlen($_GET['page']) >1)
{
$yesPage=$_GET['page'];
}
else
{
$yesPage='';
}
$grab=ngegrab('https://www.googleapis.com/youtube/v3/search?key=AIzaSyBnlKXr67V4r8FhChDj-jJU6M4snYNEYSE&part=snippet&order=relevance&maxResults=10&q='.$qu.'&pageToken='.$yesPage.'&type=video');
$json = json_decode($grab);
$nextpage=$json->nextPageToken;
$prevpage=$json->prevPageToken;
if($json)
{
foreach ($json->items as $hasil)
{
$link= $hasil->id->videoId;
$name= $hasil->snippet->title;
$desc = $hasil->snippet->description;
$chtitle = $hasil->snippet->channelTitle;
$chid = $hasil->snippet->channelId;
$date = dateyt($hasil->snippet->publishedAt);
$hasil=ngegrab('https://www.googleapis.com/youtube/v3/videos?key=AIzaSyBnlKXr67V4r8FhChDj-jJU6M4snYNEYSE&part=contentDetails,statistics&id='.$link.'');
$dt=json_decode($hasil);
foreach ($dt->items as $dta)
{
$time=$dta->contentDetails->duration;
$duration= format_time($time);
$views= $dta->statistics->viewCount;
}
echo '<div class="menu">';
echo '<div class="link">';
echo '<a href="/download_video/'.$link.'.html">';
echo '<table>';
echo '<tbody>';
echo '<tr valign="middle">';
echo '<td>';
echo '<img src="http://ytimg.googleusercontent.com/vi/'.$link.'/0.jpg" alt="Thumbnail" height="60" width="90" class="thumb">';
echo '</td>';
echo '<td style="padding-left:2px;">';
echo '<div style="padding-bottom:1px;">';
echo '<td valign="top">';
echo '<b>'.$name.'</b><br />Duration: '.$duration.' Min';
echo '</td>';
echo '</tr>';
echo '</tbody>';
echo '</table>';
echo '</a>';
echo '</div>';
echo '</div>';
}
echo '<div align="center">';
if (strlen($prevpage)>1)
{
if (strlen($_GET['q'])>1)
{
echo '<a href="/search/'.$_GET['q'].'/page='.$prevpage.'" class="page">«Prev</a>';
}
}
if (strlen($nextpage)>1)
{
if (strlen($_GET['q'])>1)
{
echo '<a href="/search/'.$_GET['q'].'/page='.$nextpage.'" class="page">Next»</a>';
}
}
echo '</div>';
}
if(!empty($_GET['q']) AND empty($_GET['page'])){$user_query = ''.$_GET['q'].'
';
write_to_file($user_query);}
include 'includes/foot.php';
?>