playlists-http-0.2.1.1: Library to glue together playlists and http-client

Safe HaskellNone
LanguageHaskell2010

Text.Playlist.HTTP.Full

Description

A more complete interface for recursively downloading a Playlist. For a simple interface for downloading playlists see Simple.

Synopsis

Documentation

download :: forall m. MonadIO m => Environment -> Text -> m (Either Error Playlist) Source #

Given an Environment and a URL, recursively download and process a playlist.

For an example of using this function see the example.hs file included in this package.

data Error Source #

Possible error values produced while downloading and resolving a Playlist.

Constructors

InvalidURL Text

URL could not be parsed.

ResponseTooLarge

Byte limit exceeded.

ProtocolError HttpException

HTTP/Network error.

FailedToParse String

Invalid playlist format.

FailedOnException String

Unknown exception.

Instances
Show Error Source # 
Instance details

Defined in Text.Playlist.HTTP.Full

Methods

showsPrec :: Int -> Error -> ShowS #

show :: Error -> String #

showList :: [Error] -> ShowS #

data Environment Source #

Details needed by the download function to operate.

Constructors

Environment 

Fields

  • httpManager :: Manager

    A Manager object from the Client library. If you want the download to take place via a TLS/SSL connection you need to create the Manager object correctly using the http-client-tls package.

  • httpByteCheck :: Int -> ByteStatus

    A function that is used to limit the number of bytes that are downloaded while recursively processing playlists.

    It is given the current number of bytes that have been downloaded/processed and should return a ByteStatus.

data ByteStatus Source #

A status flag used to indicate if a download byte limit has been reached.

Constructors

Continue

Continue processing network data.

LimitReached

Abort playlist processing.