From b6fe91b0161c0b352c80ad6135a5d46cd5826565 Mon Sep 17 00:00:00 2001 From: Niels Simenon Date: Sat, 15 Feb 2020 02:04:46 +0100 Subject: [PATCH] Added profile avatar and release scraping to Full Porn Network. --- config/default.js | 18 +++++++++++++++++- src/scrapers/fullpornnetwork.js | 32 +++++++++++++++++++++++++++++--- src/scrapers/scrapers.js | 13 +++++++++++++ 3 files changed, 59 insertions(+), 4 deletions(-) diff --git a/config/default.js b/config/default.js index 7ead1d50..65608468 100644 --- a/config/default.js +++ b/config/default.js @@ -43,7 +43,7 @@ module.exports = { 'brazzers', 'milehighmedia', [ - // Nubiles; use the same scraper, but different results per site + // Nubiles 'nubiles', 'nubilesporn', 'deeplush', @@ -66,6 +66,22 @@ module.exports = { 'confessionsxxx', 'cuckedxxx', ], + [ + // Full Porn Network + 'analized', + 'hergape', + 'jamesdeen', + 'dtfsluts', + 'analbbc', + 'analviolation', + 'baddaddypov', + 'girlfaction', + 'homemadeanalwhores', + 'mugfucked', + 'onlyprince', + 'pervertgallery', + 'povperverts', + ], 'kellymadison', 'bangbros', 'ddfnetwork', diff --git a/src/scrapers/fullpornnetwork.js b/src/scrapers/fullpornnetwork.js index 0cbe2422..d6695739 100644 --- a/src/scrapers/fullpornnetwork.js +++ b/src/scrapers/fullpornnetwork.js @@ -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, }; diff --git a/src/scrapers/scrapers.js b/src/scrapers/scrapers.js index ae6661ea..ac6edd44 100644 --- a/src/scrapers/scrapers.js +++ b/src/scrapers/scrapers.js @@ -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,