· 6 years ago · Apr 09, 2020, 03:00 PM
1<?php
2$token = "EAAAAUaZA8jlABAPdYx1lLtDI3PlcC0SPflf0t7UVSVnFTHS8G5J9wmx18raY3dQuejuivWaENzToAZAZApjWBZBOHMY5eZCdh48yNZC27cnVPSZCzZBmaddat2szV3GRxWmxiQZA8rkkm5lfVDnsZCuEImLZCpFWgYsyDZAKn9HR1A7na3YOuh9xpSMP0FdjtaRGJKQZD";
3function GetID_FB($link){
4 preg_match('/https:\/\/www.facebook.com\/(.*)\/videos\/(.*)\/(.*)\/(.*)/U', $link, $id);
5 if(isset($id[4])){
6 $result = $id[3];
7 } else {
8 preg_match('/https:\/\/www.facebook.com\/(.*)\/videos\/(.*)\/(.*)/U', $link, $id); // link dạng https://www.facebook.com/userName/videos/IDVideo/
9 if(isset($id[3])){
10 $result = $id[2];
11 }else{
12 preg_match('/https:\/\/www.facebook.com\/groups\/(.*)\/permalink\/(.*)/', $link, $id); // link dạng https://www.facebook.com/groups/IDGroups/permalink/IDVideo/
13 $result = $id[2];
14 $result = substr($result, 0, -1);
15 }
16 }
17 return $result;
18}
19//cache
20$expire = 3600;
21function getlink($url, $type) {
22 global $expire;
23 $urlnew = str_replace(array(".","://","/"),array("_","_","_"),$url);
24 $dir = '/home/cache/';
25 $file = '/home/cache/'.$urlnew.'.txt';
26 if (!is_dir($dir)) {
27 mkdir($dir, 0777);
28 }
29 if(file_exists($file) && filemtime($file) > (time() - $expire)) {
30 $dataplay = file_get_contents($file);
31 } else {
32 switch($type) {
33 case "archive":
34 $content = get_archive($url);
35 break;
36 case "zoolz":
37 $content = get_zoolz($url);
38 break;
39 case "theartistunion":
40 $content = get_theartistunion($url);
41 break;
42 case "clyp":
43 $content = get_clyp($url);
44 break;
45 }
46 savecache($urlnew,$content);
47 $dataplay = $content;
48 }
49 return $dataplay;
50}
51function savecache($name,$content) {
52 $file = 'cache/'.$name.'.txt';
53 $fp = fopen($file, "w");
54 fputs($fp, $content);
55 fclose($fp);
56}
57function gethtml($url, $data = "", $token = ""){
58 $ch = @curl_init();
59 curl_setopt($ch, CURLOPT_URL, $url);
60 $head[] = "Connection: keep-alive";
61 $head[] = "Keep-Alive: 300";
62 $head[] = "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7";
63 $head[] = "Accept-Language: en-us,en;q=0.5";
64 if($data && $token) {
65 $head[] = "X-Fb-Connection-Bandwidth: 17293134";
66 $head[] = "X-Fb-Sim-Hni: 310270";
67 $head[] = "X-Fb-Net-Hni: 310260";
68 $head[] = "Authorization: OAuth $token";
69 $head[] = "X-Fb-Connection-Quality: EXCELLENT";
70 $head[] = "X-Fb-Connection-Type: WIFI";
71 $head[] = "User-Agent: [FBAN/FB4A;FBAV/153.0.0.54.88;FBBV/84570987;FBDM/{density=2.0,width=768,height=1184};FBLC/vi_VN;FBRV/85070460;FBCR/Android;FBMF/Genymotion;FBBD/generic;FBPN/com.facebook.katana;FBDV/Custom Phone - 4.1.1 - API 16 - 768x1280;FBSV/4.1.1;FBOP/1;FBCA/x86:unknown;]";
72 $head[] = "Content-Type: application/x-www-form-urlencoded";
73 $head[] = "X-Fb-Friendly-Name: DelightsMLEAnimationQuery";
74 curl_setopt($ch, CURLOPT_POST, 1);
75 curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
76 }
77 curl_setopt($ch, CURLOPT_HTTPHEADER, $head);
78 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
79 curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
80 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
81 curl_setopt($ch, CURLOPT_TIMEOUT, 60);
82 curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
83 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
84 $page = curl_exec($ch);
85 curl_close($ch);
86 return $page;
87}
88function explode_by($begin,$end,$data) {
89 $data = explode($begin,$data);
90 $data = explode($end,$data[1]);
91 return $data[0];
92}
93function get_archive($url) {
94 $html = gethtml($url);
95 $link = explode_by('property="og:video" content="','"',$html);
96 return $link;
97}
98function get_zoolz($url) {
99 $html = gethtml("http://api.very.to/zoolz/zoolz-convert.php?link=$url");
100 return $html;
101}
102function get_clyp($url) {
103 $html = file_get_contents("http://api.very.to/clypt.php?url=$sLink&type=download");
104 return $html;
105}
106function get_theartistunion($url) {
107 if(preg_match('#theartistunion.com\/tracks\/(.*)#', $url, $match)) {
108 $id = $match[1];
109 $json = gethtml("https://theartistunion.com/api/v3/tracks/$id.json");
110 $arr = json_decode($json);
111 return str_replace("https://content.theartistunion.com/tracks/audio/stream_encode/","https://d2tml28x3t0b85.cloudfront.net/tracks/audio/:original/",$arr->audio_source);
112 }
113}
114if($_SESSION["login"] == true or $listenlogin != true)
115{
116$id=$_GET['id'];
117if(empty($id) || preg_match("/\D/",$id)) {
118err_index($lang[loi_saiid]);
119}
120else {
121$query = "SELECT a.*,b.catID,b.catName,c.singerID,c.singerName,d.albumID,d.albumName,e.authorID,e.authorName,f.serverLink FROM song AS a LEFT OUTER JOIN category AS b ON a.catID = b.catID LEFT OUTER JOIN singer AS c ON a.singerID = c.singerID LEFT OUTER JOIN album AS d ON a.albumID = d.albumID LEFT OUTER JOIN author AS e on a.authorID = e.authorID LEFT OUTER JOIN server AS f ON a.serverID = f.serverID WHERE sID = '$id'";
122 //echo $query; exit();
123$result = mysql_query ($query) or die("No song!!!");
124$row=mysql_fetch_array($result);
125if( !empty($row["sID"]) ) {
126$sID = $row["sID"];
127$sName = $row["sName"];
128$sLink = $row["sLink"];
129$sType = $row["sType"];
130$serverLink = $row["serverLink"];
131$kodau=khongdau($row["sName"]);
132$catID = $row["catID"];
133$catName = $row["catName"];
134$sType = $row["sType"];
135$albumID = $row["albumID"];
136$albumName = $row["albumName"];
137$singerID = $row["singerID"];
138$singerName = $row["singerName"];
139$authorID = $row["authorID"];
140$authorName = $row["authorName"];
141$sView = $row["sView"];
142$sDownload = $row["sDownload"];
143$sMonthView = $row["sMonthView"];
144$sMonthDownload = $row["sMonthDownload"];
145$sRank = $row["sRank"];
146$sRankCount = $row["sRankCount"];
147$mID = $row["mID"];
148$sLyric = $row["sLyric"];
149$sStatus = $row["sStatus"];
150$skeyword = $row["keyword"];
151$sLyric = chuyendoi( $sLyric );
152if(empty($sLyric) ) {
153}else
154{
155$sLyric =chuyendoi( $sLyric );
156}
157if ( eregi("unknown",$albumName) ) { $albumName = "<font color=999999><em>Chưa có thông tin</em></font>"; }
158if ( eregi("unknown",$authorName) ) { $authorName = "<font color=999999><em>Chưa có thông tin</em></font>"; }
159$sRankFloat = number_format($sRank,2);
160$sRank = number_format($sRank,0);
161mysql_query ("UPDATE song SET sView=(sView+1), sMonthView = (sMonthView+1) WHERE sID = '$sID'") or die("Cannot Query! Please contact Admin! #2");
162mysql_query ("UPDATE album SET albumCount = (albumCount+1) WHERE albumID = '$albumID'") or die("Cannot Query! Please contact Admin! #3");
163mysql_query ("UPDATE singer SET singerCount = (singerCount+1) WHERE singerID = '$singerID'") or die("Cannot Query! Please contact Admin! #4");
164mysql_query ("UPDATE author SET authorCount = (authorCount+1) WHERE authorID = '$authorID'") or die("Cannot Query! Please contact Admin! #5");
165?>
166<div class="column-bit">
167<div class="seo">
168<span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb"><a href="https://dj.very.vn" itemprop="url"><span itemprop="title">Nhạc Sàn</span></a> »</span>
169<span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb"><a href="<?php echo $server;?>the-loai/<?=$catID?>/<?php echo CovertVn($catName);?>.html" itemprop="url"><span itemprop="title"><?=$catName?></span></a> »</span>
170<span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb"><a href="<?php echo $server;?>ca-sy/<?=$singerID?>/<?php echo CovertVn($singerName);?>.html" itemprop="url"><span itemprop="title"><?=$singerName?></span></a></span></div>
171<div class="content-column">
172<table width="100%" border="0" cellpadding="0" cellspacing="0">
173<td width="100%">
174<div class="tablecontent02">
175<form method="post" class='posts' name="mvoite" action="<?=$serverLink?>source/action.php"><input type="hidden" name="act" value="mvoite" /><input type="hidden" name="sID" value="<?=$sID?>"/></form>
176<div class="play_info">
177<h1 class="h1"><a href="<?php echo $server;?>nghe/<?=$sID?>/<?php echo CovertVn($sName);?>_<?php echo CovertVn($singerName);?>.html" title="<?=$sName?>"><span class='play-h1'><?=$sName?></span></a></h1>
178<p>Album: <a href="https://dj.very.vn/album/<?=$albumID?>/<?php echo CovertVn($albumName);?>.html" title="<?=$albumName?>"><?=$albumName?></a></p>
179<p>Trình bày: <a href="<?php echo $server;?>ca-sy/<?=$singerID?>/<?php echo CovertVn($singerName);?>.html" title="<?=$singerName?>"><?=$singerName?></a></p>
180<p>Thể loại: <a href="<?php echo $server;?>the-loai/<?=$catID?>/<?php echo CovertVn($catName);?>.html" title="<?=$catName?>"><?=$catName?></a></p>
181<p>Nghe: <span class="main-player"><?=$sView?></span> | Tải: <span class="main-player"><?=$sDownload?></span></p>
182</div><div class='top'></div>
183<div align="center">
184<!-- Media -->
185<div id='div-gpt-ad-1418436786161-0' style='width:336px; height:280px;'>
186<script type='text/javascript'>
187googletag.cmd.push(function() { googletag.display('div-gpt-ad-1418436786161-0'); });
188</script>
189</div>
190</div></div>
191<table align="center" cellpadding="2" cellspacing="2" width="100%">
192<td align="center">
193<?
194if(strpos($sLink , 'clyp.it') !== false){
195 $sLink = getlink($sLink, "clyp");
196} else if(strpos($sLink , 'archive') !== false && strpos($sLink , 'download') === false){
197 $sLink = getlink($sLink, "archive");
198} else if(strpos($sLink , 'theartistunion') !== false) {
199 $sLink = getlink($sLink, "theartistunion");
200} else if(strpos($sLink , 'zoolz') !== false) {
201 $sLink = getlink($sLink, "zoolz");
202} else if(strpos($sLink , 'facebook') !== false) {
203 $idfb = GetID_FB($sLink);
204 $array = array('variables' => '{"7":["'.$idfb.'"],"6":"2","2":"true","4":"true","17":80,"enable_comment_reactions":"true","enable_comment_reactions_icons":"true","max_reactors":15,"18":"image/x-auto","profile_pic_media_type":"image/x-auto","19":"contain-fit","9":768,"8":2048,"14":384,"13":2048,"12":256,"11":2048}',
205 'method' => 'post',
206 'doc_id' => '1753135334728372',
207 'query_name' => 'MediaFetchByIds',
208 'strip_defaults' => 'true',
209 'strip_nulls' => 'true',
210 'locale' => 'vi_VN',
211 'client_country_code' => 'US',
212 'fb_api_req_friendly_name' => 'MediaFetchByIds',
213 'fb_api_caller_class' => 'com.facebook.photos.mediagallery.ui.MediaGalleryFragment');
214 $data = http_build_query($array);
215 $json = gethtml("https://graph.facebook.com/graphql", $data, $token);
216 $arr = json_decode($json,true);
217 if($arr["data"]["nodes"][0]["playable_url"]) {
218 $jw[0]["file"] = $arr["data"]["nodes"][0]["playable_url"];
219 $jw[0]["label"] = "SD";
220 $jw[0]["type"] = "mp4";
221 }
222 if($arr["data"]["nodes"][0]["hd_playable_url"]) {
223 $jw[1]["file"] = $arr["data"]["nodes"][0]["hd_playable_url"];
224 $jw[1]["label"] = "SD";
225 $jw[1]["type"] = "mp4";
226 }
227 $sLink = json_encode($jw);
228}
229if ( $sType == "flv"){
230$chuoi=$sLink;
231$email = explode("/",$chuoi);
232$machuoi = $email[2];
233if($machuoi !='dj.very.vn') {?>
234<div class="sm2-bar-ui compact flat full-width">
235
236 <div class="bd sm2-main-controls">
237
238 <div class="sm2-inline-texture"></div>
239 <div class="sm2-inline-gradient"></div>
240
241 <div class="sm2-inline-element sm2-button-element">
242 <div class="sm2-button-bd">
243 <a href="<?php echo $server;?>nghe/<?=$sID?>/<?php echo CovertVn($sName);?>_<?php echo CovertVn($singerName);?>.html#play" class="sm2-inline-button sm2-icon-play-pause">Play / pause</a>
244 </div>
245 </div>
246
247 <div class="sm2-inline-element sm2-inline-status">
248
249 <div class="sm2-playlist">
250 <div class="sm2-playlist-target">
251 <!-- playlist <ul> + <li> markup will be injected here -->
252 <!-- if you want default / non-JS content, you can put that here. -->
253 <noscript><p>JavaScript is required.</p></noscript>
254 </div>
255 </div>
256
257 <div class="sm2-progress">
258 <div class="sm2-row">
259 <div class="sm2-inline-time">0:00</div>
260 <div class="sm2-progress-bd">
261 <div class="sm2-progress-track">
262 <div class="sm2-progress-bar"></div>
263 <div class="sm2-progress-ball"><div class="icon-overlay"></div></div>
264 </div>
265 </div>
266 <div class="sm2-inline-duration">0:00</div>
267 </div>
268 </div>
269
270 </div>
271
272 <div class="sm2-inline-element sm2-button-element sm2-volume">
273 <div class="sm2-button-bd">
274 <span class="sm2-inline-button sm2-volume-control volume-shade"></span>
275 <a href="<?php echo $server;?>nghe/<?=$sID?>/<?php echo CovertVn($sName);?>_<?php echo CovertVn($singerName);?>.html#volume" class="sm2-inline-button sm2-volume-control">volume</a>
276 </div>
277 </div>
278
279 </div>
280
281 <div class="bd sm2-playlist-drawer sm2-element">
282
283 <div class="sm2-inline-texture">
284 <div class="sm2-box-shadow"></div>
285 </div>
286
287 <!-- playlist content is mirrored here -->
288
289 <div class="sm2-playlist-wrapper">
290 <ul class="sm2-playlist-bd">
291 <li><a href="<?=$sLink?>"><b><?=$sName?></b> - <span class="label"><?=$singerName?></span></a></li>
292 </ul>
293 </div>
294
295 </div>
296
297</div>
298
299<?php }?>
300<? } else { ?>
301<?php
302if(strpos($sLink , 'fbcdn') !== false){
303?>
304<script type="text/javascript" src="/jwplayer7/jwplayer.js"></script>
305<script>jwplayer.key = "op6qqwLQtAzw+JX3Bxe9y5DjfomqoOvistAaPA==";</script>
306<div id="player-content"></div>
307<script type="text/javascript">
308 jwplayer("player-content").setup({
309 sources: <?=$sLink;?>,
310 width: "465",
311 height: "300",
312 controls: true,
313 autostart: true,
314 allowfullscreen: false,
315 repeat: true,
316 skin: "tube"
317 });
318</script>
319<?php } else { ?>
320<script src="https://ssl.p.jwpcdn.com/player/v/8.1.3/jwplayer.js"></script>
321<script type="text/javascript">jwplayer.key = "W7zSm81+mmIsg7F+fyHRKhF3ggLkTqtGMhvI92kbqf/ysE99";</script>
322</head>
323<body style="margin: unset;">
324<div id="mediaplayer"></div>
325</body>
326<script>
327 var player = jwplayer("mediaplayer");
328 player.setup({
329 playbackRateControls: [0.75, 1, 1.25, 1.5],
330 key: "MBvrieqNdmVL4jV0x6LPJ0wKB/Nbz2Qq/lqm3g==",
331 autostart: false,
332 controls: true,
333 volume: 100,
334 primary: "html5",
335 skin: {
336 "controlbar": {
337 "background": "rgba(0,0,0,0)",
338 "icons": "rgba(255,255,255,0.8)",
339 "iconsActive": "#FFFFFF",
340 "text": "#F2F2F2"
341 },
342 "menus": {
343 "background": "#333333",
344 "text": "rgba(255,255,255,0.8)",
345 "textActive": "#FFFFFF"
346 },
347 "timeslider": {
348 "progress": "#F2F2F2",
349 "rail": "rgba(255,255,255,0.3)"
350 },
351 "tooltips": {
352 "background": "#FFFFFF",
353 "text": "#000000"
354 }
355 },
356 stretching: "uniform",
357 width: "465",
358 height: "300",
359 autostart: true,
360 repeat: true,
361 allowfullscreen: true,
362 allowscriptaccess: "always",
363 file: "<?=$sLink;?>",
364 type: "video/mp4",
365});
366</script>
367<?php
368}
369if($sType=='sends')
370echo '-->';
371?>
372<?php if($sType=='send') echo '-->'?>
373<? } ?>
374</td><tr><td align="center">
375<p>
376<div class="fb-like" data-href="<?php echo curPageURL();?>" data-colorscheme="light" data-layout="button_count" data-action="like" data-show-faces="false" data-send="false"></div>
377<!-- AddToAny BEGIN -->
378<a class="a2a_dd" href="//www.addtoany.com/share_save?linkurl=<?php echo curPageURL();?>&linkname=<?=$status?>"><img src="<?=$serverLink?>Icons/share_save_171_16.png" width="131" height="19" border="0" alt="Share"/></a>
379<script type="text/javascript" src="//static.addtoany.com/menu/page.js"></script>
380<!-- AddToAny END -->
381<div id="download-area">
382<div class='button02'>
383<form rel='nofollow' action="<?php echo $server;?>song.php?act=download&id=<?=$sID?>" id="downloadform" target="_blank" method="post">
384<a href="javascript:void(0)" onclick="document.getElementById('downloadform').submit(); return false;" class='button01' title='DOWNLOAD'><img src="<?=$serverLink?>Icons/downloadbtn.png" />DOWNLOAD</a>
385</form>
386</div>
387</div>
388<span class='main-player01'>Các bạn NGHE & DOWNLOAD MP3 chất lượng <span class='main-player02'><b>320Kbps</b></span> hoàn toàn MIỄN PHÍ không cần đăng ký Tài khoản!<br><span class="main-player">Hãy ủng hộ DJ.very.vn bằng cách giới thiệu tới bạn bè và người wen của bạn nhé.</span>
389<div class='top'></div>
390<div class='shared'><div class='shared01'><div class='shared02'><b><span class='shared03'>Copy & gởi Link:</span></b></div><div class='shared04'><input class='shared05' onClick="this.select();" readonly="readonly" value="<?php echo $server;?>nghe/<?=$sID?>/<?php echo CovertVn($sName);?>_<?php echo CovertVn($singerName);?>.html" size="45"></div></div></div></td></tr><tr bgcolor="#000000"><td>
391<div id="show_div">
392<div class='shared06'>
393<a name="loibaihat"></a>
394<h2 class='sLyric'><?=smiles( $sLyric )?></h2>
395</div></div></td></tr></table></div></td></tr></table></div></div>
396<? if(!empty($skeyword)){ include("source/tagcloud.php"); }?>
397<? if($albumName!="") include("source/swithalbum.php");?>
398<?
399} else {
400err_index("Ca khúc này không tồn tại hoặc đã bị xóa khỏi cơ sở dữ liệu!");
401} // kiem tra ton tai bai hat hay khong?
402}
403} else {
404err_index("Để nghe nhạc bạn cần đăng nhập<br><br>Hãy <a rel='nofollow' href='dang-nhap.html'>Đăng nhập</a> hoặc <a rel='nofollow' href='dang-ky.html'>Đăng ký</a> ngay bây giờ");
405}
406?>