This repository has been archived by the owner on Nov 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrev.php
70 lines (58 loc) · 2.43 KB
/
rev.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
function get_by_curl($url){
//echo "curl:url<pre>".$url."</pre><BR>";
$options = array(
CURLOPT_RETURNTRANSFER => true, // return web page
CURLOPT_HEADER => false, // don't return headers
CURLOPT_ENCODING => "", // handle all encodings
CURLOPT_USERAGENT => "spider", // who am i
CURLOPT_AUTOREFERER => true, // set referer on redirect
CURLOPT_CONNECTTIMEOUT => 15, // timeout on connect
CURLOPT_TIMEOUT => 15, // timeout on response
CURLOPT_MAXREDIRS => 10, // stop after 10 redirects
CURLOPT_SSL_VERIFYPEER => false,
);
$ch = curl_init($url);
curl_setopt_array( $ch, $options );
$content = curl_exec( $ch );
$err = curl_errno( $ch );
$errmsg = curl_error( $ch );
$header = curl_getinfo( $ch,CURLINFO_EFFECTIVE_URL );
curl_close( $ch );
//$header['errno'] = $err;
// $header['errmsg'] = $errmsg;
//change errmsg here to errno
if ($errmsg)
{
echo "";
}
return $content;
}
?>
<?php
if(isset($_GET['link'])) {
$link23 = $_GET['link'];
$id = explode('/', $_GET['link']);
$id = explode('.html', $id[5]);
$api = 'http://api.mp3.zing.vn/api/mobile/video/getvideoinfo?keycode=fafd463e2131914934b73310aa34a23f&requestdata={"id":"'.$id[0].'"}';
$get = get_by_curl($api);
preg_match('/"title":"(.*)","/U', $get, $tieude);
$tieude = str_replace('\/', '/', $tieude[1]);
preg_match('/"240":"(.*)","/U', $get, $mp4_240p);
$mp4_240p = str_replace('\/', '/', $mp4_240p[1]);
preg_match('/"360":"(.*)",/U', $get, $mp4_360p);
$mp4_360p = str_replace('\/', '/', $mp4_360p[1]);
preg_match('/"480":"(.*)",/U', $get, $mp4_480p);
$mp4_480p = str_replace('\/', '/', $mp4_480p[1]);
preg_match('/"720":"(.*)",/U', $get, $mp4_720p);
$mp4_720p = str_replace('\/', '/', $mp4_720p[1]);
preg_match('/"1080":"(.*)"}/U', $get, $mp4_1080p);
$mp4_1080p = str_replace('\/', '/', $mp4_1080p[1]);
//echo "<center>Tải Video ".$tieude." từ Zing Mp3</center>";
//echo $mp4_240p;
echo $mp4_360p;
//echo "<center><a href='http://nghenhac.luutru360.com/dw.php?url=".$mp4_480p."' >Chất lượng 480P</a></center>";
//echo "<center><a href='http://nghenhac.luutru360.com/dw.php?url=".$mp4_720p."' >Chất lượng 720P</a></center>";
//echo "<center><a href='http://nghenhac.luutru360.com/dw.php?url=".$mp4_1080p."' >Chất lượng 1080P</a></center>";
}
?>