Add atom feed, update main script and fix some issues
This commit is contained in:
parent
cf8262d3cb
commit
30cd0ba548
5 changed files with 326 additions and 109 deletions
|
|
@ -17,10 +17,14 @@ function get_info($url)
|
|||
}
|
||||
}
|
||||
|
||||
if ($i < $nbLign)
|
||||
if ($i+2 < $nbLign)
|
||||
{
|
||||
$filename = preg_replace("#^(.+)\.([a-zA-Z0-9]{1,4})$#", '\1.mp3', $ec[$i+3]);
|
||||
return array($ec[$i], $ec[$i+1], $ec[$i+2], $ec[$i+3], trim($filename));
|
||||
if ($ec[$i+3] == "-- ")
|
||||
@$filename = preg_replace("#^(.+)\.([a-zA-Z0-9]{1,4})$#", '\1.mp3', $ec[$i+2]);
|
||||
else
|
||||
@$filename = preg_replace("#^(.+)\.([a-zA-Z0-9]{1,4})$#", '\1.mp3', $ec[$i+3]);
|
||||
@$filenameogg = preg_replace("#^(.+)\.([a-zA-Z0-9]{1,4})$#", '\1.ogg', $filename);
|
||||
return @array($ec[$i], $ec[$i+1], $ec[$i+2], $ec[$i+3], trim($filename), trim($filenameogg));
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
|
|
@ -50,13 +54,19 @@ if (isset($_GET["f"]))
|
|||
if ($k == $_GET["f"])
|
||||
{
|
||||
$musik = get_info($lign);
|
||||
if (isset($musik) && is_file(MAIN_DIR."/content/".$musik[4]))
|
||||
if (isset($musik) && (is_file(MAIN_DIR."/content/".$musik[4]) || is_file(MAIN_DIR."/content/".$musik[5])))
|
||||
{
|
||||
$filename = MAIN_DIR."/content/".$musik[4];
|
||||
if (is_file(MAIN_DIR."/content/".$musik[5]))
|
||||
$filename = MAIN_DIR."/content/".$musik[5];
|
||||
else
|
||||
$filename = MAIN_DIR."/content/".$musik[4];
|
||||
|
||||
header('Content-Description: File Transfer');
|
||||
header('Content-Type: application/octet-stream');
|
||||
header("Content-Disposition: attachment; filename=\"".$musik[1].".mp3\"");
|
||||
if (is_file(MAIN_DIR."/content/".$musik[5]))
|
||||
header("Content-Disposition: attachment; filename=\"".$musik[1].".ogg\"");
|
||||
else
|
||||
header("Content-Disposition: attachment; filename=\"".$musik[1].".mp3\"");
|
||||
header('Content-Transfer-Encoding: binary');
|
||||
header('Expires: 0');
|
||||
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
|
||||
|
|
@ -70,4 +80,4 @@ if (isset($_GET["f"]))
|
|||
}
|
||||
}
|
||||
die ("Fichier introuvable");
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
Reference in a new issue