pixiv-0.1.1: Pixiv API binding based on servant-client
Copyright(c) 2021 The closed eye of love
MaintainerPoscat <poscat@mail.poscat.moe>, berberman <berberman@yandex.com>
Safe HaskellNone



A set of utilities for downloading pixiv things.


DownloadM monad

type DownloadM = MaybeT (ReaderT Manager IO) Source #

DownloadM monad is a synonym for IO computation wrapped in Manager environment, which may exit without producing value, indicating the download failed.

liftMaybe :: Maybe a -> DownloadM a Source #

Lifts a pure Maybe value to DownloadM.

liftToPixivT :: MonadIO m => DownloadM a -> PixivT m (Maybe a) Source #

Lifts a download computation to PixivT.

DownloadM needs Manager to perform the download, which can be provided by TokenState.

runDownloadM :: Manager -> DownloadM a -> IO (Maybe a) Source #

Executes the download computation in IO.

Download actions

downloadPixiv :: Text -> DownloadM ByteString Source #

Downloads something in DownloadM, given url.

downloadSingleIllust :: Illust -> DownloadM ByteString Source #

Downloads a single page illust.

Chooses the first one if the illust has many pages, preferring high quality images. Returns Nothing if can't find any image url.

downloadUgoiraToMP4 Source #


:: UgoiraMetadata

Information of ugoira to download

-> Maybe FilePath

Path to ffmpeg

-> DownloadM (String, ByteString) 

Downloads UgoiraFrames, then converts it to MP4 calling external ffmpeg.