traxxx/src/scrapers/amateurallure.js

50 lines
1.7 KiB
JavaScript
Raw Normal View History

2020-03-01 04:28:08 +00:00
'use strict';
const { fetchLatest, fetchScene } = require('./julesjordan');
function extractActors(scene) {
const release = scene;
2020-03-01 04:28:08 +00:00
if (!scene.actors || scene.actors.length === 0) {
const introActorMatches = scene.title.match(/(?:presents|introduces|features|welcomes) (\w+ \w+)/i);
const introTwoActorMatches = scene.title.match(/(?:presents|introduces|features|welcomes) (?:(\w+)|(\w+ \w+)) and (\w+ \w+)/i);
const returnActorMatches = scene.title.match(/(?:(^\w+)|(\w+ \w+))(?:,| (?:return|visit|pov|give|suck|lick|milk|love|enjoy|service|is))/i);
const returnTwoActorMatches = scene.title.match(/(\w+ \w+) and (?:(\w+)|(\w+ \w+)) (?:return|visit|give|suck|lick|milk|love|enjoy|service|are)/i);
2020-03-01 04:28:08 +00:00
const rawActors = (introTwoActorMatches || introActorMatches || returnTwoActorMatches || returnActorMatches)?.slice(1);
const actors = rawActors?.filter((actor) => {
if (!actor) return false;
if (/swallow|\bcum|fuck|suck|give|giving|take|takes|taking|head|teen|babe|cute|beaut|naughty|teacher|nanny|adorable|brunette|blonde|bust|audition|from|\band\b|\bto\b/i.test(actor)) return false;
2020-03-01 04:28:08 +00:00
return true;
});
2020-03-01 04:28:08 +00:00
if (actors) {
release.actors = actors;
}
}
2020-03-01 04:28:08 +00:00
if (release.actors?.length > 1 || /threesome|threeway/.test(scene.title)) {
release.tags = scene.tags ? [...scene.tags, 'mff'] : ['mff'];
}
2020-03-01 04:28:08 +00:00
return release;
2020-03-01 04:28:08 +00:00
}
async function fetchLatestWrap(site, page = 1) {
const latest = await fetchLatest(site, page);
2020-03-01 04:28:08 +00:00
return latest.map(scene => extractActors(scene));
2020-03-01 04:28:08 +00:00
}
async function fetchSceneWrap(url, site) {
const scene = await fetchScene(url, site);
2020-03-01 04:28:08 +00:00
return extractActors(scene);
2020-03-01 04:28:08 +00:00
}
module.exports = {
fetchLatest: fetchLatestWrap,
fetchScene: fetchSceneWrap,
2020-03-01 04:28:08 +00:00
};