Added profile avatar and release scraping to Full Porn Network.

This commit is contained in:
2020-02-15 02:04:46 +01:00
parent 958c2b625c
commit b6fe91b016
3 changed files with 59 additions and 4 deletions

View File

@@ -1,8 +1,9 @@
'use strict';
const { get, geta } = require('../utils/q');
const { get, geta, ctxa } = require('../utils/q');
const slugify = require('../utils/slugify');
function scrapeLatest(scenes) {
function scrapeAll(scenes) {
return scenes.map(({ el, q, qa, qd, qu, ql }) => {
const release = {};
@@ -48,11 +49,24 @@ function scrapeScene({ q, qa, qd, qtx }, url) {
return release;
}
function scrapeProfile({ el, q }) {
const profile = {};
profile.avatar = [
q('.model-image img', 'src0_2x'),
q('.model-image img', 'src0_1x'),
];
profile.releases = scrapeAll(ctxa(el, '.update'));
return profile;
}
async function fetchLatest(site, page = 1) {
const url = `${site.url}/categories/movies_${page}_d.html`;
const qLatest = await geta(url, '.latest-updates .update');
return qLatest && scrapeLatest(qLatest, site);
return qLatest && scrapeAll(qLatest, site);
}
async function fetchScene(url, site) {
@@ -61,7 +75,19 @@ async function fetchScene(url, site) {
return qScene && scrapeScene(qScene, site);
}
async function fetchProfile(actorName, scraperSlug) {
const actorSlug = slugify(actorName, { delimiter: '' });
const url = scraperSlug === 'povperverts'
? `https://povperverts.net/models/${actorSlug}.html`
: `https://${scraperSlug}.com/models/${actorSlug}.html`;
const qProfile = await get(url);
return qProfile && scrapeProfile(qProfile, actorName);
}
module.exports = {
fetchLatest,
fetchScene,
fetchProfile,
};

View File

@@ -132,6 +132,19 @@ module.exports = {
kellymadison,
legalporno,
men,
analbbc: fullpornnetwork,
analized: fullpornnetwork,
analviolation: fullpornnetwork,
baddaddypov: fullpornnetwork,
dtfsluts: fullpornnetwork,
girlfaction: fullpornnetwork,
hergape: fullpornnetwork,
homemadeanalwhores: fullpornnetwork,
jamesdeen: fullpornnetwork,
mugfucked: fullpornnetwork,
onlyprince: fullpornnetwork,
pervertgallery: fullpornnetwork,
povperverts: fullpornnetwork,
metrohd,
milehighmedia,
mofos,