Exemple #1
0
<?php

$p = new Playlist();
require dirname(__FILE__) . '/main.php';
Config::set('DEBUG', 'OFF');
$p->fetch();
$p->parse();
if (empty($p->links)) {
    exit('No audio files found');
}
if (count($p->links) > 3) {
    $p->store();
}
//debug($p);
$p->headers();
$p->output();
class Playlist
{
    function __construct()
    {
        if (!($url = $_GET['url'])) {
            exit('url parameter required');
        }
        if (parse_url($url, PHP_URL_SCHEME) != 'http') {
            exit('valid url parameter required');
        }
        $this->url = preg_replace('/\\#*$/', '', $url);
        $this->format = $_GET['format'] ? str_replace('.', '', $_GET['format']) : 'm3u';
    }
    function fetch()
    {