Файл: inc/song.php
Строк: 221
<style>@media screen and (max-width: 640px){.aimg{position:absolute;border-radius:50%;text-align:right;margin-right:70px;width:60px;height:60px;right:0;top:10px}.vid{height:100%;width:100%}}@media screen and (min-width: 650px){.aimg{position:absolute;border-radius:50%;text-align:right;margin-right:62px;width:100px;height:100px;right:0;top:20px}.vid{height:315px;width:100%}}.img-qr{margin-right:5px;vertical-align:top;opacity:.75;width:40px;height:40px}.img-qr:hover{margin-right:5px;opacity:1;vertical-align:top;width:40px;height:40px}
</style>
<div id="xbody-left">
<div class="onesongblock"><?php
$get_a=explode('-',$_GET["s"]);
$aid=$get_a[0];
$artist=$get_a[1];
if($_GET["a"][0]=="-"){
$_GET["a"][0]='|';
}
$get_s=explode('-',$_GET["a"]);
$oid=str_replace('|','-',$get_s[0]);
$title=$get_s[1];
$q3=$artist.' '.$title;
$code='API.audio.getById({"audios":"'.$oid.'_'.$aid.'"}),API.audio.getRecommendations({"target_audio":"'.$oid.'_'.$aid.'","count":"10"}),API.newsfeed.search({"q":"'.$q3.'","count":"3"}),API.video.search({"q":"'.$q3.'","sort":"2","count":"1","filters":"youtube","longer":"60","shorter":"600"}),API.audio.search({"q":"'.$artist.'","performer_only":"1","sort":"0","count":"5"}), API.users.get({"user_ids":"'.$oid.'"})';
$code='return ['.$code.'];';
$p2=strip_tags(@file_get_contents('http://138.201.49.196/api.php?method=execute&code='.base64_encode(base64_encode($code)).'&format=json&key='.$api_key));
$p=json_decode(trim(ltrim($p2)),true);
if(empty($p['response'][0][0]['title'])){
$p=strip_tags(@file_get_contents('http://138.201.49.196/api.php?method=execute&code='.base64_encode(base64_encode($code)).'&format=json&nocache='.time().'&key='.$api_key));
$p=json_decode(trim(ltrim($p)),true);
}
if($p2=="wrong key" or $p2=="wrong key format"){
$notice="ICAgICDQndC10LLQtdGA0L3Ri9C5INC60LvRjtGHPGJyPgrQn9GA0L7QstC10YDRjNGC0LUg0L/RgNCw0LLQuNC70YzQvdC+0YHRgtGMINCy0LLQvtC00LAg0LjQu9C4INC/0L7Qu9GD0YfQuNGC0LUg0L3QvtCy0YvQuSDQvdCwINGB0LDQudGC0LU8YnI+PGJyPiA8YSBocmVmPSJodHRwOi8vYXBpLnhuLS00MWEud3MiPmFwaS54bi0tNDFhLndzPC9hPjxicj4=";
echo "<br><b>".base64_decode($notice)."</b><br>";
}elseif($p2=="not enough money"){
$notice2="ICAgICDQndC10LTQvtGB0YLQsNGC0L7Rh9C90L4g0LTQtdC90LXQsyDQuNC70Lgg0L3QtSDRg9GB0YLQsNC90L7QstC70LXQvSDQutC70Y7Rhzxicj4K0KPRgtC+0YfQvdC40YLQtSDQvdCwINGB0LDQudGC0LUgPGEgaHJlZj0iaHR0cDovL2FwaS54bi0tNDFhLndzIj5hcGkueG4tLTQxYS53czwvYT48YnI+";
echo "<br><b>".base64_decode($notice2)."</b><br>";
}
if(isset($p['response'][2]['items'][0]['text']) && !empty($p['response'][2]['items'][0]['text']) && $p['response'][2]['items'][0]['text']!="Подключение к iTunes Store."){
$iii=0;
$text_s=$p['response'][2]['items'][0]['text'];
}elseif(isset($p['response'][2]['items'][1]['text']) && !empty($p['response'][2]['items'][1]['text']) && $p['response'][2]['items'][1]['text']!="Подключение к iTunes Store."){
$iii=1;
$text_s=$p['response'][2]['items'][1]['text'];
}elseif(isset($p['response'][2]['items'][2]['text']) && !empty($p['response'][2]['items'][2]['text']) && ($p['response'][2]['items'][2]['text'])!="Подключение к iTunes Store."){
$iii=2;
$text_s=$p['response'][2]['items'][2]['text'];
}else{
$iii=0;
}
if($iii==0){
if(isset($p['response'][2]['items'][0]['attachments'][0]['photo']['photo_130'])){
$photo_s=$p['response'][2]['items'][0]['attachments'][0]['photo']['photo_130'];
if(isset($p['response'][2]['items'][2]['date'])){
$post_date_s=$p['response'][2]['items'][2]['date'];
}
}elseif(isset($p['response'][2]['items'][0]['attachments'][1]['photo']['photo_130'])){
$photo_s=$p['response'][2]['items'][0]['attachments'][1]['photo']['photo_130'];
$post_date_s=$p['response'][2]['items'][2]['date'];
}elseif(isset($p['response'][2]['items'][0]['attachments'][2]['photo']['photo_130'])){
$photo_s=$p['response'][2]['items'][0]['attachments'][2]['photo']['photo_130'];
$post_date_s=$p['response'][2]['items'][2]['date'];
}else{
$photo_s='';
}
}elseif($iii==1){
if(isset($p['response'][2]['items'][1]['attachments'][0]['photo']['photo_130'])){
$photo_s=$p['response'][2]['items'][1]['attachments'][0]['photo']['photo_130'];
$post_date_s=$p['response'][2]['items'][2]['date'];
}else{
$photo_s='';
}
}elseif($iii==2){
if(isset($p['response'][2]['items'][2]['attachments'][0]['photo']['photo_130'])){
$photo_s=$p['response'][2]['items'][2]['attachments'][0]['photo']['photo_130'];
$post_date_s=$p['response'][2]['items'][2]['date'];
}else{
$photo_s='';
}
}
$title = $p['response'][0][0]['title'];
$date=$p['response'][0][0]['date'];
$artist =$p['response'][0][0]['artist'];
$img_f='artists/img/'.filtr($artist).'.png';
if(file_exists($img_f)){
}else{
$lf=json_decode(str_replace('#','',@file_get_contents('http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist='.str_replace(' ','%20',trim($artist)).'&api_key='.$key_lf.'&lang=RU&format=json')));
if(isset($lf->artist->image[1]->text)){
$img_lf=$lf->artist->image[1]->text;
}else{
$img_lf='';
$img_f='';
}
if(!empty($img_lf)){
$img_p=@file_get_contents($img_lf);
fopen($img_f, 'w+');
file_put_contents($img_f, $img_p);
}
}
if(!empty($img_f) && file_exists($img_f)){
if(filesize($img_f)==15140 or filesize($img_f)==21230 or filesize($img_f)==19831 or filesize($img_f)==14679 or filesize($img_f)==28373 or filesize($img_f)==42497 or filesize($img_f)==15231 or filesize($img_f)==14680 or filesize($img_f)==26083 or filesize($img_f)==42007){
$img_f='';
}
}
$dur = $p['response'][0][0]['duration'];
$play =$p['response'][0][0]['play'];
$dw =$p['response'][0][0]['download'];
if(isset($p['response'][0][0]['lyrics_id'])){
$lyrics_idn = $p['response'][0][0]['lyrics_id'];
}
if(isset($p['response'][0][0]['genre_id'])){
$genre=$p['response'][0][0]['genre_id'];
}else{
$genre='0';
}
if(isset($text_s) && isset($photo_s) && !empty($text_s) && !empty($photo_s)){
$filtr=array('http://','www','.ru','.com','.net','vk.com','https://','.org','.html','.php');
$text_s=str_replace('/',' ',str_replace($filtr,'', mb_substr($text_s,0,200,'UTF-8')));
$opisanie='<h2 class="small_biography-title"><b>'.$artist.'</b><i>'.$title.'</i></h2><div class="small_biography-p"><div class="small_biography-prw"><img src="http://data2.api.xn--41a.ws/images/'.base64_encode(base64_encode($photo_s)).'.jpg" width="100%" height="100%"></div><i> '.$text_s.'...</i></div>';
}else{
$opisanie='';
}
include 'titles.php';
$fartist=filtr2(filtr($artist));
$ftitle=filtr2(filtr($title));
$ftitle=low_filtr_song($ftitle);
$fartist=low_filtr($fartist);
$lnk='/скачать-мп3/'.$oid.'-'.$fartist.'/'.$aid.'-'.$ftitle.'/';
if($_SERVER['SCRIPT_URL']!=$lnk){
header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
//header("Location: $lnk");
}
$dur1=$dur*1000;
$min=floor($dur/60);
$sec=$dur-($min*60);
if($sec<10){$sec='0'.$sec;}
if($min<10){$min='0'.$min;}
$duration=$min.':'.$sec;
$url = $p['response'][0][0]['url'];
$mp3 = str_replace(' ','_',filtr($title)." - ".filtr($artist));
$mp3=filtr($mp3);
$url2='http://data2.api.xn--41a.ws/files2/'.str_replace('0','-',base64_encode(base64_encode($url))).'/'.base64_encode(base64_encode($_SERVER["REMOTE_ADDR"])).'/'.$mp3.'_(mp3.vc).mp3';
if(isset($p['response'][3]['items'][0]['player'])){
$video=str_replace('vk.api','api.xn--41a.ws',$p['response'][3]['items'][0]['player']);
}
if($m==0 && isset($video) && isset($lyrics_idn) && isset($img_f)){
if($oid[0]=='-'){
$oid[0]='|';
}
$lnk_q='/'.$oid.'-'.$fartist.'/'.$aid.'-'.$ftitle.'/';
query_write($lnk_q);
}
?>
<div class="onesongblock-tit_and_dur">
<h1 class="onesongblock-title">
<b><?php echo $artist;?></b>
<i>–</i>
<em><?php echo $title;?></em>
</h1>
<span class="onesongblock-duration"><?php echo $duration;?></span>
</div>
<?php if(file_exists($img_f)){ ?>
<img src="/<?php echo $img_f;?>" alt="<?php echo $artist;?>" title="<?php echo $artist;?>" class="aimg">
<?php } ?>
<span class="onesongblock-filesize">Размер: <b><?php echo round($dur*320/8/1024,2);?> МБ</b> Жанр: <?php echo razdel($genre); ?></span><br><br>
<span class="onesongblock-filesize">Добавлено: <?php echo my_date($date);?><br> Автор: <b><a href='https://vk.com/id<?php echo $oid;?>'><?php echo $p['response'][5][0]['first_name'].' '.$p['response'][5][0]['last_name'];?></a></b></span>
<div class="onesongblock-btns">
<a href="javascript:void(0);" class="psv_btn rtform-green player-playback playlist-play" data-index="0" data-id="<?php echo $oid;?>" data-mp3="<?php echo $play.'?i='.base64_encode(base64_encode($_SERVER["REMOTE_ADDR"]));?>" data-duration="<?php echo $dur*1000;?>">Прослушать</a>
<a href="<?php echo $dw.'?i='.base64_encode(base64_encode($_SERVER["REMOTE_ADDR"]));?>" class="psv_btn rtform-blue">Скачать</a>
</div>
<div class="onesongblock-share_block">
<span class="rt_share"></span>
</div>
<br>
</div>
<?php
if($vk_c==1){ ?>
<div id="vk_comments"></div>
<script>VK.Widgets.Comments("vk_comments", {limit: 10, width: "*", attach: false, pageUrl: window.location.href});</script>
<br>
<?php } ?>
<?php
if(isset($video)){ ?>
<div class="onesongblock">
<div class="onesongblock-tit_and_dur">
<h3 class="onesongblock-title">
<b>Смотреть клип</b>
<i>–</i>
<em><?php echo str_replace('-',' ',filtr($p['response'][3]['items'][0]['title']));?></em>
</h3>
</div>
<iframe class="vid" style="width: 100%" src="<?php echo $video;?>" frameborder="0"></iframe>
</div>
<?php } ?>
<?php
include 'like.php';
?>
</div>