andl.de

9. Februar 2010

Perl Script M3U Playlist

Abgelegt unter: Allgemein — alex @ 22:46


use MP3::Tag;
use File::Find;

my $path = $ARGV 0 ;
print "#EXTM3U\n";
find (\&d, $path);

exit;

sub d {

my $file = $File::Find::name;

if ($file =~ /$path\/(.*\.mp3)/) {
my $mp3 = MP3::Tag->new($file);
$comment = $mp3->comment();
($title, $track, $artist, $album, $comment, $year, $genre) = $mp3->autoinfo();
print "#EXTINF:-1,$artist/$title ($album)\n$1\n";
}

}

Powered by WordPress ( WordPress Deutschland )