-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.php
More file actions
136 lines (108 loc) · 2.91 KB
/
run.php
File metadata and controls
136 lines (108 loc) · 2.91 KB
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<html>
<link rel="stylesheet" type="text/css" href="css/foundation.min.css">
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<style type="text/css">
body{
background-color:#f5f5f5;
}
a:link {
color: blue;
}
/* mouse over link */
a:hover {
color:yellow;
}
/* selected link */
a:active {
color: black;
}
</style>
<body>
<div class="row">
<div class="large-4 large-centered columns">
<img border="0" src="/img/as.png" alt="SoundCloudDownloder"/>
</div>
<div class="row">
<div class="large-5 large-centered columns">
<h3 class="subheader">SoundCloud Downloader Online</h3>
</div>
<div class="row">
<div class="large-7 large-centered columns">
<h3 class="subheader">Download any track /playlist from SoundCloud</h3>
</div>
<form method="get" <?php echo "action '".$_SERVER['PHP_SELF']."'"?> >
<div class="row">
<div class="large-8 large-centered columns">
<div class="row collapse">
<div class="small-10 columns">
<input type="url" name='value' required placeholder="Copy SoundCloud Track/ Playlist">
</div>
<div class="small-2 columns">
<input type="submit" class="button postfix" value="Go">
</div>
</div>
</div>
</div>
</form>
<?php
if(isset($_GET['value'])){
$url=$_GET['value'];
$url_api='https://api.soundcloud.com/resolve.json?url='.$url.'&client_id=22e8f71d7ca75e156d6b2f0e0a5172b3';
$json = file_get_contents($url_api);
$obj=json_decode($json);
if($obj->kind=='playlist'){
echo "<div class='row'>
<div class='large-7 large-centered columns'>";
echo "<table>
<thead>
<tr>
<th>Track count</th>
<th>Track Title</th>
<th>Track download</th>
</tr>
</thead>
<tbody>
";
$index=0;
foreach ($obj->tracks as $key) {
$url_str=$key->stream_url.'?client_id=1edfe9605870313cafeeeca3a1bcf44a';
$index++;
# code..
echo "<div class='row collapse'>";
echo "<tr>";
echo "<td class='small-2 columns'>".$index."</td>";
echo "<td class='small-10 columns'>'".$key->title."</td>";
echo "<td class='small-2 columns'><a href='".$url_str."'download>Download</a></td>";
echo "</tr>
</div>";
}
echo "
</tbody>
</table>" ;
echo "
</div>
</div>";
}
else{
$url_str=$obj->stream_url.'?client_id=1edfe9605870313cafeeeca3a1bcf44a';
echo "<div class='large-6 large-centered columns'>";
echo "<a href='".$url_str."'download>".$obj->title."</a>";
echo "</div>";
}
}
?>
</div>
</div>
<div class="row">
<h3 class="subheader">SoundCloud Downloader Online</h3>
<p>soundCloud downloader is online tool to download SoundCloud tracks and music. SoundCloud is audio distribution site, where users can record, upload and promote their sound tracks. SoundCloud allows you to listen as many tracks you can but it does not allow sound track download.
</p>
</div>
<script type="text/javascript">
$('a').click(function(e) {
e.preventDefault();
//do other stuff when a click happens
});
</script>
</body>
</html>