View file f.php

File size: 3.2Kb
<?php
error_reporting(0);
function ngegrab($url){
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
	$uaa = $_SERVER['HTTP_USER_AGENT'];
    curl_setopt($ch, CURLOPT_USERAGENT, "User-Agent: $uaa");

    return curl_exec($ch);
}
function samgrab($url){$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch,CURLOPT_ENCODING,'gzip');
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, '1');
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$header[] = "Accept-Language: en";
$header[] = "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
";
$header[] = "Pragma: no-cache";
$header[] = "Cache-Control: no-cache";
$header[] = "Accept-Encoding: gzip,deflate";
$header[] = "Content-Encoding: gzip";
$header[] = "Content-Encoding: deflate";
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
$load = curl_exec($ch);
curl_close($ch);
return $load;}

function samkey($id)
{
$sam   = samgrab('http://'.$host.'/key.php?host='.$id.'');
$wattoo= 'QUl6YVN5Q3lac3pzcnhfTVdXWWpWcloxTDBMMFpyQ3FMam12S21j';
if($sam){$key=base64_decode($sam);}else{$key=base64_decode($wattoo);}
return $key;
}
$key= samkey($juttlog);

function sam($content,$start,$end){
if($content && $start && $end) {
$r = explode($start, $content);
if (isset($r[1])){
$r = explode($end, $r[1]);
return $r[0];}
return '';}}

function format_time($t) {
$sam = str_replace('PT','',$t);
$sam = str_replace('H',':',$sam);
$sam = str_replace('M',':',$sam);
$sam = str_replace('S','',$sam);
return $sam;}




function format_time1($t,$f=':'){
if($t < 3600){
return sprintf("%02d%s%02d", floor($t/60)%60, $f, $t%60);
}else{
return sprintf("%02d%s%02d%s%02d", floor($t/3600), $f, ($t/60)%60, $f, $t%60);
}
}
function write_to_file($q)
{$filename = 'sitemap.txt';
$fh = fopen($filename, "a");
if(flock($fh, LOCK_EX))
{fwrite($fh, $q);
flock($fh, LOCK_UN);}
fclose($fh);}

function dateyt($date)
{
	$sam = str_replace('T',' ',$date);
	$sam = str_replace('.000Z','',$sam);
	return $sam;
}

function format_size($size){$filesizename=array(" Bytes"," KB"," MB"," GB"," TB"," PB"," EB"," ZB"," YB");
return $size ? round($size/pow(1024,($i=floor(log($size,1024)))),2).$filesizename[$i] : '0 Bytes';}
function querydecode($q){$q=preg_replace("/[^A-Za-z0-9[:space:]]/","$1",strip_tags(ucwords(strtolower($q))));
$q=str_replace(' ','-',$q);
return $q;
}
function queryencode($q){
$q=str_replace('-',' ',strip_tags($q));
$q=ucwords($q);
return $q;
}
function getlinkdl($id){$grab=json_decode(ngegrab('http://api.soundcloud.com/tracks/'.$id.'/streams?client_id=02gUJC0hH2ct1EGOcYXQIzRFU91c72Ea'));
$link=$grab->http_mp3_128_url;
return $link;
}
function getfilesize($url) {$data=get_headers($url, true);
if (isset($data['Content-Length']))
return (int)$data['Content-Length'];}

function potong($content,$start,$end){
if($content && $start && $end) {
$r = explode($start, $content);
if (isset($r[1])){
$r = explode($end, $r[1]);
return $r[0];}
return '';}}

function clearspace($q){
$qu=str_replace(" ","+", $q);
$qu=str_replace("-","+", $qu);
$qu=str_replace("_","+", $qu);
return $qu;
}

?>