Added profile scraper to Pascals Subsluts.

This commit is contained in:
DebaucheryLibrarian
2020-09-16 01:42:15 +02:00
parent 286d48c02b
commit 7fd7005776
6 changed files with 30 additions and 16 deletions

View File

@@ -1,7 +1,9 @@
'use strict';
const qu = require('../utils/q');
const slugify = require('../utils/slugify');
const capitalize = require('../utils/capitalize');
const { feetInchesToCm } = require('../utils/convert');
function scrapeAll(months, channel, year) {
return months.map(({ query: queryMonth, el }) => {
@@ -40,23 +42,32 @@ function scrapeScene({ html }, url) {
return release;
}
/*
function scrapeProfile({ query, el }, actorName, entity, include) {
function scrapeProfile({ query }) {
const profile = {};
profile.description = query.cnt('.bio-text');
profile.birthPlace = query.cnt('.birth-place span');
const bio = query.all('.about-desc li').reduce((acc, el) => {
const key = query.cnt(el, 'strong');
const value = query.text(el);
profile.avatar = query.img('.actor-photo img');
return {
...acc,
[slugify(key, '_')]: value,
};
}, {});
if (include.releases) {
return scrapeAll(qu.initAll(el, '.scene'));
}
profile.nationality = bio.nationality;
profile.height = feetInchesToCm(bio.height);
profile.age = bio.age;
profile.hair = bio.hair;
profile.description = query.cnt('.twocolumns');
profile.avatar = query.img('#individual-description img');
// no dates or links available
// profile.releases = scrapeAll(qu.initAll(query.all('.individal-video-item'))); // sic
console.log(profile);
return profile;
}
*/
async function fetchLatest(channel, page = 1) {
const year = new Date().getFullYear() - (page - 1);
@@ -81,20 +92,21 @@ async function fetchScene(url, channel) {
return res.status;
}
/*
async function fetchProfile({ name: actorName }, entity, include) {
const url = `${entity.url}/actors/${slugify(actorName, '_')}`;
const res = await qu.get(url);
const url = `${entity.url}/submissive/subslut-${slugify(actorName)}.php`;
const res = await qu.get(url, null, null, {
followRedirects: false,
});
if (res.ok) {
if (res.ok && res.status === 200) {
return scrapeProfile(res.item, actorName, entity, include);
}
return res.status;
}
*/
module.exports = {
fetchLatest,
fetchScene,
fetchProfile,
};

View File

@@ -234,6 +234,7 @@ module.exports = {
pimpxxx: cherrypimps,
letsdoeit: porndoe,
mamacitaz: porndoe,
pascalssubsluts,
porncz,
pornhub,
povperverts: fullpornnetwork,