Simple library for reading and writing playlist's files. Supported formats: m3u, pls, wpl, zpl.
https://www.nuget.org/packages/PlaylistsNET
WplContent content = new WplContent();
WplPlaylist playlist = content.GetFromStream(stream);
// or
var parser = PlaylistParserFactory.GetPlaylistParser(".wpl");
IBasePlaylist playlist = parser.GetFromStream(stream);
List<string> paths = playlist.GetTracksPaths();
M3uPlaylist playlist = new M3uPlaylist();
playlist.IsExtended = true;
playlist.PlaylistEntries.Add(new M3uPlaylistEntry()
{
Album = "New album",
AlbumArtist = "",
Duration = TimeSpan.FromSeconds(175),
Path = @"C:\Music\song.mp3",
Title = "Track Title"
});
M3uContent content = new M3uContent();
string text = content.ToText(playlist);
// or
string text = PlaylistToTextHelper.ToText(playlist);
/*
#EXTM3U
#EXTALB:New album
#EXTINF:175,Track Title
C:\Music\song.mp3
*/