https://github.com/tmk907/playlistsnet
Simple library for reading and writing playlist's files. Supported formats: m3u, pls, wpl, zpl.
https://github.com/tmk907/playlistsnet
m3u netstandard playlist playlist-parser playlists pls wpl
Last synced: 7 months ago
JSON representation
Simple library for reading and writing playlist's files. Supported formats: m3u, pls, wpl, zpl.
- Host: GitHub
- URL: https://github.com/tmk907/playlistsnet
- Owner: tmk907
- License: mit
- Created: 2018-04-07T16:17:27.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-01-05T10:40:26.000Z (almost 2 years ago)
- Last Synced: 2024-04-27T06:20:53.755Z (over 1 year ago)
- Topics: m3u, netstandard, playlist, playlist-parser, playlists, pls, wpl
- Language: C#
- Homepage: https://www.nuget.org/packages/PlaylistsNET/
- Size: 139 KB
- Stars: 35
- Watchers: 5
- Forks: 11
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PlaylistsNET
Simple library for reading and writing playlist's files. Supported formats: m3u, pls, wpl, zpl.
## Install
[](https://www.nuget.org/packages/PlaylistsNET) [https://www.nuget.org/packages/PlaylistsNET](https://www.nuget.org/packages/PlaylistsNET)
## Examples
### Read
```c#
WplContent content = new WplContent();
WplPlaylist playlist = content.GetFromStream(stream);
// or
var parser = PlaylistParserFactory.GetPlaylistParser(".wpl");
IBasePlaylist playlist = parser.GetFromStream(stream);
List paths = playlist.GetTracksPaths();
```
### Save
```c#
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
*/
```