| Copyright | (c) 2021 The closed eye of love |
|---|---|
| License | BSD-3-Clause |
| Maintainer | Poscat <poscat@mail.poscat.moe>, berberman <berberman@yandex.com> |
| Stability | alpha |
| Portability | portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Web.Pixiv.Download
Contents
Description
A set of utilities for downloading pixiv things.
Synopsis
- type DownloadM = MaybeT (ReaderT Manager IO)
- liftMaybe :: Maybe a -> DownloadM a
- liftToPixivT :: MonadIO m => DownloadM a -> PixivT m (Maybe a)
- runDownloadM :: Manager -> DownloadM a -> IO (Maybe a)
- downloadPixiv :: Text -> DownloadM ByteString
- downloadSingleIllust :: Illust -> DownloadM ByteString
- downloadUgoiraToMP4 :: UgoiraMetadata -> Maybe FilePath -> DownloadM (String, ByteString)
DownloadM monad
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.
Arguments
| :: UgoiraMetadata | Information of ugoira to download |
| -> Maybe FilePath | Path to |
| -> DownloadM (String, ByteString) |
Downloads UgoiraFrames, then converts it to MP4 calling external ffmpeg.