README
Pornpics javascript crawler
pornpics javascript crawler is a node module that allows you to crawl pornpics.com and save picture automatically.
Features
- Fetch gallery informations
- Fetch category galleries
- Save gallery
- Save category
Installation
Install globally
npm i -g pornpics
or
yarn global add pornpics
Install localy
npm i pornpics
or
yarn add pornpics
CLI usage (global)
pornpics <category_url|gallery_url> <dest>
Example:
pornpics https://www.pornpics.com/ass/ pictures
Options
no subdirectories (bool, default: false) -a, --aggregate
Downloads all pictures into the same directory regardless of which gallery it belongs to.
-p, --page <n>
starting page (int, default: 1)
Specifies which page should the crawler start at.
(int, default: 1) -l, --limit <n>
Specifies how many pages should the crawler crawl.
(bool, default: false) -c, --cover
Only downloads gallery covers. It only works with categories.
API (local)
Basic example
const Pornpics = require('pornpics-crawler')
const crawler = new Pornpics({
url: 'https://www.pornpics.com/ass/',
page: 1,
limit: 1,
dest: 'dest',
aggregate: true,
cover: false
})
crawler.on('error', err => {
console.error(err)
})
// Fires when a gallery has been successfully fetched
crawler.on('downloaded', gallery => {
console.log(`'${gallery.title}' gallery fetched`) // gallery picture links are in gallery.pictures
})
crawler.on('download-end', _ => {
console.log(`crawl has ended`)
})
Constructor options
(required, string) url
The url of the desired category or gallery.
(int, default: 1) page
The page the crawler will start at.
(int, default: 1) limit
The amount of pages the crawler will crawl.
(string, default: null) dest
The destination directory if you want to save the crawled pictures. If no dest
option is provided, no picture will be saved.
(bool, default: false) aggregate
If dest
option is provided and if aggregate
is true, all pictures will be downloaded into the same directory regardless of which gallery it belongs to.
(bool, default: false) cover
If dest
option is provided and if cover
is true, the crawler will only save gallery covers. It only works with categories.
Events
(gallery) fetch
Fires when a gallery has been crawled.
end
Fires when crawl has ended.
(gallery) downloaded
Fires when a gallery has been downloaded.
download-end
Fires when crawl download has ended.