0.3.1 • Published 4 years ago

pixiv-client v0.3.1

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

pixiv-client

Pixiv api client for node.js written in typescript.

Example

// ES6:
import { PixivDesktopApi, PixivMobileApi, downloadAsStream } from 'pixiv-client'
// Commomjs:
const { PixivDesktopApi, PixivMobileApi, downloadAsStream } = require('pixiv-client')

;(async () => {
  // Desktop api examples
  const dc = await PixivDesktopApi.create() // no after-login function in PixivDesktopApi
  const r = await dc.getIllustData(70337017)
  downloadAsStream(r.urls.original).pipe(fs.createWriteStream(__dirname + '/test.png')) // or `await downloadToLocal(r.urls.original, __dirname + '/test.png')`
  console.log(await dc.getUserProfileData(5323203))

  // Mobile api examples
  const mc = await PixivMobileApi.login({
    username: 'USERNAME',
    password: 'PASSWORD'
  })
  console.log(await mc.getRanking('day'))
  console.log((await mc.getUserBookmarks(mc.oauth.info.user.id)).illusts)

  // Working with async iterator
  const ar = []
  const result = await c.searchIllusts('ノゾミ(プリコネ)', {
    searchTarget: 'exact_match_for_tags'
  })
  for await (const r of c.makeIterable(result)){
    ar.push(...r.illusts)
  }
  console.log(ar.length)
})()

Documentation

0.3.1

4 years ago

0.3.0

5 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago