0.1.3 • Published 7 years ago

pixiv-img-dl v0.1.3

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

pixiv-img-dl

Build Status

中文

a simple way to save pixiv images to local using nodejs

Installation

npm i pixiv-img-dl --save

Test

npm test

API

fetch(imgUrl, savePath)

  • imgUrl: pixiv image url, just a string
  • savePath: path to save image, it should be a existed directory. by default it's path.resolve('./images').
  • return value: a promise.

example

const pixiv = require('pixiv-img-dl');
const url = 'https://i.pximg.net/img-original/img/2017/05/01/23/42/02/62683748_p0.png';

pixiv
  .fetch(url)
  .then(value => {
      console.log(value); // {name: '62683748_p0.png'}
  })
  .catch(console.log);

fetchAll(imgUrls, concurrencyQueue, savePath)

  • imgUrls: a array of imgUrl.
  • concurrencyQueue: an array of concurrency, eg. 10,5,2, the first time, concurrency is 10, if someting failed, it will retry in concurrency 5, finally 2.

example

const pixiv = require('pixiv-img-dl');
const urls = ['https://i.pximg.net/img-original/img/2017/05/01/23/42/02/62683748_p0.png',
 'https://i.pximg.net/img-original/img/2017/05/20/15/28/57/62982851_p0.png'];

pixiv
  .fetchAll(urls, [5, 2])
  .then(console.log) // undefined
  .catch(console.log);

Cotact me

sino2322@gmail.com

License

MIT © sino

0.1.3

7 years ago

0.1.2

7 years ago

0.1.0

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago