-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
71 lines (71 loc) · 2.44 KB
/
index.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
71
<?php
error_reporting(0);
header('content-type: application/json');
$q=$_GET['q']; // Search In Ahangify
$id=$_GET['id']; // Music Id
$action=$_GET['a']; // Your Action Mode For exam Newtrack
$u=$_GET['u']; // Music Id
function ahangify($url,$data=[]){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url.'?'.http_build_query($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies.txt');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');
$headers = array();
$headers[] = 'Host: ahangify.com';
$headers[] = 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0';
$headers[] = 'Accept: application/json, text/plain, */*';
$headers[] = 'Accept-Language: en-US,en;q=0.5';
$headers[] = 'Referer: https://ahangify.com/';
$headers[] = 'X-JS-APP-VERSION: 2.9.20';
$headers[] = 'Te: Trailers';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close($ch);
return $result;
}
if(!empty($q)){
$res=ahangify('https://ahangify.com/app-api/search',[
'value'=>str_replace(' ','+',$q)
]);
die($res);
}elseif (!empty($id) && $action=='track'){
$res=ahangify('https://ahangify.com/app-api/tracks/'.$id);
die($res);
}elseif (!empty($id) && $action=='dtrack'){
$res=ahangify("https://ahangify.com/app-api/tracks/details",[
'ids[]'=>$id
]);
die($res);
}elseif (!empty($id) && $action=='artist'){
$res=ahangify('https://ahangify.com/app-api/artists/'.$id);
die($res);
}elseif (!empty($id) && $action=='album'){
$res=ahangify('https://ahangify.com/app-api/albums/'.$id);
die($res);
}elseif ($action=='newtrack'){
$res=ahangify('https://ahangify.com/app-api/tracks');
die($res);
}elseif ($action=='ttopweek'){
$res=ahangify('https://ahangify.com/app-api/charts/tracks',[
'week'=>''
]);
die($res);
}elseif ($action=='atopweek'){
$res=ahangify('https://ahangify.com/app-api/charts/artists',[
'week'=>''
]);
die($res);
}elseif (!empty($u)){
preg_match('/^tracks\/([a-z0-9]+)\//',$u,$m);
$res=ahangify("https://ahangify.com/app-api/tracks/$m[1]/file",[
'url'=>$u
]);
die($res);
}