-
Notifications
You must be signed in to change notification settings - Fork 3
/
bgdown.php
executable file
·99 lines (89 loc) · 2.77 KB
/
bgdown.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<!DOCTYPE html>
<html>
<head>
<!--Import materialize.css-->
<link type="text/css" rel="stylesheet" href="css/materialize.min.css" media="screen,projection"/>
<!--Let browser know website is optimized for mobile-->
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>YouTuber</title>
</head>
<body>
<?php
if (!isset($_SERVER['HTTP_X_REQUESTED_WITH']) || $_SERVER['HTTP_X_REQUESTED_WITH'] != 'XMLHttpRequest')
{
echo
'
<div class="section no-pad-bot" id="index-banner">
<div class="container">
<br><br>
<h2 class="header center teal-text">
Stop Messing!
</h2>
<div class="row center">
<h5 class="header col s12 light">
I think you meant to go <a style="color:teal" href="index.html" >here</a>!
</h5>
</div>
</div>
</div>
' ;
}
else
{
function escape($stringx)
{
str_replace('"','\"',$stringx);
return $stringx;
}
// download the file
$audiourl = escape($_GET["audiourl"]);
$songname = escape($_GET["song"]);
$artistname = escape($_GET["artist"]);
$albumname = escape($_GET["album"]);
$imgurl = escape($_GET["imgurl"]);
if(preg_match('/[^\x20-\x7f]/', $songname) || preg_match('/[^\x20-\x7f]/', $artistname)|| preg_match('/[^\x20-\x7f]/', $albumname))
{
echo '
<br><br><br><br>
<h1 class="header center teal-text">
Sorry!
</h1>
<div class="row center">
<h4 class="header col s12 light">
Non ASCII titles aren\'t supported
</h4>
<h5 class="header col s12 light">
Mainly because I\'m lazy.. <a style="color:teal" href="index.html">back</a>
</h5>
</div>
';
}
else
{
$data = array();
$cmd = 'python python/downloadandtag.py "'.$audiourl.'" "'.$songname.'" "'.$artistname.'" "'.$albumname.'" "'.$imgurl.'"';
//echo $cmd;
exec($cmd, $data);
unlink("download/".$data[0].".m4a");
//system($cmd);
echo '
<br><br><br><br>
<h1 class="header center teal-text">
Done!
</h1>
<div class="row center">
<h4 class="header col s12 light">
Your file will automatically download!
</h4>
<h5 class="header col s12 light">
Click <a style="color:teal" href="index.html">here</a> to download more!
</h5>
</div>
';
}
// <iframe src="send.php?q='.urlencode($data[0]).'" style="display:none;" />
// <meta http-equiv="refresh" content="1;url=send.php?q='.$data[0].'">
}
?>
</body>
</html>