diff --git a/Downloader.php b/Downloader.php index bc843d9..c83d4a2 100644 --- a/Downloader.php +++ b/Downloader.php @@ -115,11 +115,14 @@ class Downloader $artist = str_replace( array( '#ARTIST:', '/' ), array( '', '-' ), strtok( $out, "\n" ) ); - $artist = preg_replace( "/[^a-zA-Z0-9_.!äöü\s-]/m/u", "", $artist ); + //echo $artist; + $artistes = preg_replace( '/[^a-zA-Z0-9\ \-]/', "", $artist ); $title = str_replace( array( '#TITLE:', '/' ), array( '', '-' ), strtok( "\n" ) ); - $title = preg_replace( "/[^a-zA-Z0-9_.!äöü\s-]/m/u", "", $title ); - + //echo $title; + //echo "\ns$title\n"; + $title = preg_replace( '/[^a-zA-Z0-9\ \-]/', '', $title ); + //echo "\n$title\n"; echo "[INFO] Found $artist - $title\n"; @@ -160,4 +163,4 @@ class Downloader -} \ No newline at end of file +} diff --git a/GetAll.php b/GetAll.php new file mode 100644 index 0000000..0918f08 --- /dev/null +++ b/GetAll.php @@ -0,0 +1,26 @@ +to to download karaoke-files"; +echo "\n"; +$from = readline( "@From[int] " ); +echo "\n"; +$to = readline( "@To[int] " ); + + +$downloader = new Downloader(); +for( $i=$from; $i <= $to; $i++ ) +{ + try + { + $downloader->requestSong( $i ); + }catch ( RuntimeException $e ) + { + echo "An error occurred while processing the download.\n"; + echo $e->getMessage() . "\n"; + } +} + diff --git a/config.inc.php b/config.inc.php index ff86a6a..ece005f 100644 --- a/config.inc.php +++ b/config.inc.php @@ -1,11 +1,11 @@