The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Text::Playlist::M3U - parser for 'm3u' format

SYNOPSIS

my $m3u = Text::Playlist::M3U->new;
my @items = $m3u->load('/path/to/playlist.m3u');

foreach my $item (@items) {
  # <work with playlist items>
}

$m3u->save('/path/to/new-playlist.m3u', @items);

DESCRIPTION

Lightweight parser and generator for m3u playlists. Will be usefull if you're just want to read playlist, or convert playlist to another format, or change playlist items by some way.

Methods

load

parse

save

dump

For description of these methods see description in base class Text::Playlist

Item format

Each parsed item has the following keys in hashref:

* file     -- path or url, required
* title    -- title for given item, required
* duration -- item duration in seconds, or -1 if not unknown
* attrs    -- hashref with attributes for given item, optional

SEE ALSO

MP3::M3U::Parser -- full-featured parser

AUTHORS

* Alex 'AdUser' Z <aduser@cpan.org>