@ 2014-10-28T10:31:32Z <?php
require_once 'config.php';
require_once 'functions.php';
if($_GET['url']){
$track_url = $_GET['url'];
$track_url = trim($track_url);
}
if(!$track_url){
header("Location: /?utm_source=noinput");
exit();
}
if((!filter_var($track_url, FILTER_VALIDATE_URL)) && (!empty($track_url))){
$error="Invalid URL";
}
if(!$error){
$url="http://api.soundcloud.com/resolve.json?url=".$track_url."&client_id=".$client_id;
$response_code=check_url($url);
if($response_code==404){
$error="Playlist not found";
}
if($response_code==400){
$error="Bad URL (#400)";
}
}
if(!$error){
$headers1=get_headers($url,1);
$location1=$headers1['Location'];
if(!$location1){
$headers1=get_headers($url,1);
$location1=$headers1['Location'];
}
}
if($location1){
$json = file_get_contents_curl($location1) or error_log("download error for $url");
if(!$json){
$json = file_get_contents_curl($location1) or error_log("download error again for $url");
}
if(!$json){
header("Location: /?error=1&utm_source=downloaderror");
exit();
}
} else {
$error="Unable to get playlist data";
}
if(!$error){
$obj = json_decode($json, true);
$kind=$obj['kind'];
if($kind!='playlist'){
$error="Not a playlist!";
}
}
if(!$error){
$id=$obj['id'];
$title=$obj['title'];
$sclink=$obj['permalink_url'];
$buy=$obj['purchase_url'];
$user=$obj['user'];
$user_id=$user['id'];
$user=$user['username'];
$duration=$obj['duration'];
$description=$obj['description'];
$tracks=$obj['tracks'];
$pic=$obj['artwork_url'];
$pic300=$pic;
$pagetitle="$title - $user | $sitename";
$description="Download $title for free. Listen to $title or download $title. $title Mp3, audio music. Download music using SC-DOWNLOADER.COM fast, simple and free.";
$metakeywords="$title, $user, $title by $user, $title Mp3, $title music, download $title, audio music, sc-downloader.com";
$description=str_replace('"', '\'', $description);
$metakeywords=str_replace('"', '\'', $metakeywords);
} else {
$pagetitle="Error! | $sitename";
}
$head_include_html=<<<EOF
<meta itemprop="name" content="$title" />
<meta itemprop="description" content="$description" />
<meta itemprop="image" content="$pic300" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="$title" />
<meta name="twitter:description" content="$description" />
<meta name="twitter:image:src" content="$pic300" />
<meta name="twitter:domain" content="sc-downloader.com" />
<meta property="og:title" content="$title" />
<meta property="og:type" content="music.song" />
<meta property="og:description" content="$description" />
<meta property="og:image" content="$pic300" />
<meta property="og:url" content="http://sc-downloader.com/playlist/$title-$id.html" />
<meta property="og:site_name" content="$sitename" />
<meta property="og:see_also" content="http://sc-downloader.com" />
<meta property="fb:admins" content="100001767032587" />
<link rel="canonical" href="http://sc-downloader.com/playlist/$title-$id.html" />
EOF;
require_once("assets/header.php");
?>
<?php
if($error){
echo "<h2>Error!</h2>";
echo "<p class='error'><b>Error!</b> ".$error."</p>";
} else {
echo "<h2>$title <small> ($user) </small></h2>";
echo "<p>$description</p>";
if(!is_array($tracks)) {
echo "<p class='error'>Unable to fetch playlist. Please try again!</p>";
} else {
echo "<h2>Tracks</h2>";
foreach($tracks as $track){
$link=urlencode($track['permalink_url']);
$html=<<<EOF
<a href="/download.php?url=$link&utm_source=playlist_downloader">Download $title</a>
<br/>
EOF;
}
}
}
?>
<?php
require_once("assets/footer.php");
?>
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for git.master , git.master_jit , rfc.property-hooks Warning: require_once(): open_basedir restriction in effect. File(config.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/Dch6P on line 3
Warning: require_once(config.php): Failed to open stream: Operation not permitted in /in/Dch6P on line 3
Fatal error: Uncaught Error: Failed opening required 'config.php' (include_path='.:') in /in/Dch6P:3
Stack trace:
#0 {main}
thrown in /in/Dch6P on line 3
Process exited with code 255 . This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.
Active branches Archived branches Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page
preferences:dark mode live preview
42.23 ms | 401 KiB | 8 Q