playlists

Library and executable for working with playlist files. https://github.com/pjones/playlists

Latest on Hackage:0.4.1.0

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.

BSD3 licensed and maintained by Peter Jones

Haskell Playlists Library and Tool

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 io-streams at some point in the future.

Library Example

import qualified Data.ByteString as BS
import Text.Playlist

readPlaylist :: 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

Changes

Version 0.4.1.0 (February 5, 2017)

  • Remove redundant constraints as reported by GHC 8.X.

  • Widen dependency versions to latest available.

Version 0.4.0.0 (November 21, 2016)

  • Added the resolve function. If you have a playlist that contains references to remote playlists, this new function will recursively download and process playlists until it has a flat playlist with no further remote references.

    See the playlists-http package for an example of using the resolve function.

  • Added the parserForFormat function which directly exposes the attoparsec parser for each playlist type. This should make it easy to write space efficient functions that parse playlists.

Version 0.3.0.0 (January 24, 2015)

  • Update dependencies to recent versions (thanks to Wieland Hoffmann).
comments powered byDisqus