Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pjones/playlists
Library and executable for working with playlist files.
https://github.com/pjones/playlists
haskell m3u playlist-files pls
Last synced: 2 months ago
JSON representation
Library and executable for working with playlist files.
- Host: GitHub
- URL: https://github.com/pjones/playlists
- Owner: pjones
- License: other
- Created: 2013-06-20T20:42:01.000Z (over 11 years ago)
- Default Branch: trunk
- Last Pushed: 2024-05-16T15:52:01.000Z (8 months ago)
- Last Synced: 2024-10-11T23:43:23.777Z (3 months ago)
- Topics: haskell, m3u, playlist-files, pls
- Language: Haskell
- Homepage: https://hackage.haskell.org/package/playlists
- Size: 77.1 KB
- Stars: 12
- Watchers: 3
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- License: LICENSE
Awesome Lists containing this project
README
# Haskell Playlists Library and Tool
[![tests](https://github.com/pjones/playlists/actions/workflows/tests.yml/badge.svg)](https://github.com/pjones/playlists/actions/workflows/tests.yml)
[![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/pjones/playlists?label=release)](https://github.com/pjones/playlists/releases)
[![Hackage](https://img.shields.io/hackage/v/playlists)](https://hackage.haskell.org/package/playlists)Playlists is a library for working with media playlist files. The
original motivation for the library was extracting URLs for streaming
radio stations that use PLS and M3U playlist files.The package also includes an executable that can dump the URLs from a
playlist file and convert between playlist file formats.## Supported Formats
* [PLS][]
* [M3U and M3U8][M3U]## Future Plans
Some playlist files can be really big. I plan on adding support for
incremental parsing and generating via `pipes` at some point in the
future.## Library Example
```haskell
import qualified Data.ByteString as BS
import Text.PlaylistreadPlaylist :: Format -> IO Playlist
readPlaylist fmt = do
content <- BS.getContents
case parsePlaylist fmt content of
Left err -> fail $ "failed to parse playlist on stdin: " ++ err
Right x -> return x
```## Executable Example
$ playlist urls --format PLS < somefile.pls
$ playlist convert --from PLS --to M3U < somefile.pls
[pls]: http://en.wikipedia.org/wiki/PLS_(file_format)
[m3u]: http://en.wikipedia.org/wiki/M3U