Refactored 21sextury scraper.
This commit is contained in:
@@ -9,8 +9,6 @@ const moment = require('moment');
|
||||
const { heightToCm } = require('../utils/convert');
|
||||
const { matchTags } = require('../tags');
|
||||
|
||||
const pluckPhotos = require('../utils/pluck-photos');
|
||||
|
||||
async function fetchPhotos(url) {
|
||||
const res = await bhttp.get(url);
|
||||
|
||||
@@ -58,14 +56,7 @@ async function getPhotos(entryId, site, page = 1) {
|
||||
})
|
||||
: [];
|
||||
|
||||
const allPhotos = photos.concat(otherPhotos.flat());
|
||||
|
||||
const photoLimit = (site.network.parameters && site.network.parameters.photoLimit) || 25;
|
||||
const photoIndexes = pluckPhotos(allPhotos.length - 1, photoLimit);
|
||||
|
||||
const pluckedPhotos = photoIndexes.map(photoIndex => allPhotos[photoIndex]);
|
||||
|
||||
return pluckedPhotos;
|
||||
return photos.concat(otherPhotos.flat());
|
||||
}
|
||||
|
||||
function scrapeLatest(html, site) {
|
||||
|
||||
Reference in New Issue
Block a user