Fixed Nubiles base poster query, handling trailing commas in qu source set. Added profile scene scraper to Dogfart. Added tag photo.

This commit is contained in:
DebaucheryLibrarian 2021-01-11 16:20:01 +01:00
parent e38922f372
commit db4e74fb99
11 changed files with 64 additions and 32 deletions

View File

@ -0,0 +1,5 @@
<!-- Generated by IcoMoon.io -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<title>feed</title>
<path d="M6 8c0-1.105 0.895-2 2-2s2 0.895 2 2c0 1.105-0.895 2-2 2s-2-0.895-2-2zM10.38 3.602c1.56 0.846 2.62 2.498 2.62 4.398s-1.059 3.552-2.62 4.398c0.689-1.096 1.12-2.66 1.12-4.398s-0.431-3.302-1.12-4.398zM4.5 8c0 1.738 0.431 3.302 1.12 4.398-1.56-0.846-2.62-2.498-2.62-4.398s1.059-3.552 2.62-4.398c-0.689 1.096-1.12 2.66-1.12 4.398zM1.5 8c0 2.686 0.85 5.097 2.198 6.746-2.223-1.421-3.698-3.911-3.698-6.746s1.474-5.325 3.698-6.746c-1.348 1.649-2.198 4.060-2.198 6.746zM12.302 1.254c2.223 1.421 3.698 3.911 3.698 6.746s-1.474 5.325-3.698 6.746c1.348-1.649 2.198-4.060 2.198-6.746s-0.85-5.097-2.198-6.746z"></path>
</svg>

After

Width:  |  Height:  |  Size: 772 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -792,8 +792,9 @@ const tagPhotos = [
['dv-tp', 1, 'Adriana Chechik in "Adriana\'s Triple Anal Penetration!"'],
['dv-tp', 0, 'Luna Rival in LegalPorno SZ1490'],
['ebony', 1, 'Ana Foxxx in "DP Me 4" for HardX'],
['facial', 2, 'Ashly Anderson for Hookup Hotshot'],
['facial', 3, 'Paige Owens in "Oral Restraint" for Babes'],
['facial', 'poster', 'Jynx Maze'],
['facial', 2, 'Ashly Anderson for Hookup Hotshot'],
['facefucking', 6, 'Halle Hayes in "Towering Temptress" for 5K Porn'],
['facefucking', 1, 'Paige Owens in "Dark Meat 12" for Evil Angel'],
['facefucking', 0, 'Ashly Anderson in "Rough Love" for Hookup Hotshot'],

View File

@ -6,6 +6,8 @@ const { JSDOM } = require('jsdom');
const moment = require('moment');
const http = require('../utils/http');
const slugify = require('../utils/slugify');
const qu = require('../utils/qu');
async function getPhotos(albumUrl) {
const res = await http.get(albumUrl);
@ -20,39 +22,39 @@ async function getPhotos(albumUrl) {
return {
url: pageUrl,
extract: ({ qu }) => qu.q('.scenes-module img', 'src'),
extract: ({ query }) => query.img('.scenes-module img'),
};
});
return photoUrls;
}
function scrapeLatest(html, site) {
function scrapeLatest(html, site, filter = true) {
const { document } = new JSDOM(html).window;
const sceneElements = Array.from(document.querySelectorAll('.recent-updates'));
return sceneElements.reduce((acc, element) => {
const siteUrl = element.querySelector('.help-block').textContent;
return sceneElements.map((element) => {
const siteUrl = element.querySelector('.recent-details-title .help-block, .model-details-title .site-name').textContent;
if (`www.${siteUrl.toLowerCase()}` !== new URL(site.url).host) {
if (filter && `www.${siteUrl.toLowerCase()}` !== new URL(site.url).host) {
// different dogfart site
return acc;
return null;
}
const sceneLinkElement = element.querySelector('.thumbnail');
const url = `https://dogfartnetwork.com${sceneLinkElement.href}`;
const url = qu.prefixUrl(sceneLinkElement.href, 'https://dogfartnetwork.com');
const { pathname } = new URL(url);
const entryId = `${site.slug}_${pathname.split('/')[4]}`;
const title = element.querySelector('.scene-title').textContent;
const actors = title.split(/[,&]|\band\b/).map(actor => actor.trim());
const actors = title.split(/[,&]|\band\b/).map(actor => actor.replace(/BTS/i, '').trim());
const poster = `https:${element.querySelector('img').src}`;
const teaser = sceneLinkElement.dataset.preview_clip_url;
return [
...acc,
{
const channel = siteUrl?.match(/(.*).com/)?.[1].toLowerCase();
return {
url,
entryId,
title,
@ -62,9 +64,9 @@ function scrapeLatest(html, site) {
src: teaser,
},
site,
},
];
}, []);
channel,
};
}).filter(Boolean);
}
async function scrapeScene(html, url, site) {
@ -97,8 +99,8 @@ async function scrapeScene(html, url, site) {
const poster = `https:${trailerElement.dataset.poster}`;
const { trailer } = trailerElement.dataset;
const lastPhotosUrl = Array.from(document.querySelectorAll('.pagination a')).slice(-1)[0].href;
const photos = await getPhotos(`${origin}${pathname}${lastPhotosUrl}`, site, url);
const lastPhotosUrl = Array.from(document.querySelectorAll('.pagination a')).slice(-1)[0]?.href;
const photos = lastPhotosUrl ? await getPhotos(`${origin}${pathname}${lastPhotosUrl}`, site, url) : [];
const stars = Math.floor(Number(document.querySelector('span[itemprop="average"]')?.textContent || document.querySelector('span[itemprop="ratingValue"]')?.textContent) / 2);
const tags = Array.from(document.querySelectorAll('.scene-details .categories a')).map(({ textContent }) => textContent);
@ -137,7 +139,23 @@ async function fetchScene(url, site) {
return scrapeScene(res.body.toString(), url, site);
}
async function fetchProfile(baseActor, entity) {
const slug = slugify(baseActor.name, '+');
const url = `https://www.dogfartnetwork.com/tour/girls/${slug}/`;
const res = await http.get(url);
if (res.ok) {
const scenes = scrapeLatest(res.body, entity, false);
return { scenes };
}
return res.status;
}
module.exports = {
fetchLatest,
fetchScene,
fetchProfile,
};

View File

@ -45,8 +45,9 @@ function scrapeAll(scenes, site, origin) {
release.date = qu.date('.date', 'MMM D, YYYY');
release.actors = qu.all('.models a.model', true);
const poster = qu.q('img').dataset.original;
release.poster = [
const poster = qu.sourceSet('img', 'data-srcset')?.[0];
release.poster = poster && [
poster.replace('_640', '_1280'),
poster,
];

View File

@ -197,6 +197,7 @@ const scrapers = {
devilsfilm: famedigital,
digitalplayground,
dtfsluts: fullpornnetwork,
dogfartnetwork: dogfart,
dorcelclub: dorcel,
doubleviewcasting: firstanalquest,
elegantangel,

View File

@ -253,7 +253,7 @@ function urls(context, selector = 'a', attr = 'href', { origin, protocol = 'http
return attr ? urlEls.map(urlEl => prefixUrl(urlEl, origin, protocol)) : urlEls;
}
function sourceSet(context, selector, attr, options = {}) {
function sourceSet(context, selector, attr = 'srcset', options = {}) {
const srcset = q(context, selector, attr);
if (!srcset) {
@ -265,11 +265,16 @@ function sourceSet(context, selector, attr, options = {}) {
.map((source) => {
const [link, descriptor] = source.split(' ');
if (link) {
return {
descriptor: descriptor || 'fallback',
url: prefixUrl(link, options.origin, options.protocol),
};
}
return null;
})
.filter(Boolean)
.sort((sourceA, sourceB) => {
if (sourceB.descriptor === 'fallback' || parseInt(sourceA.descriptor, 10) > parseInt(sourceB.descriptor, 10)) {
return -1;

View File

@ -79,6 +79,7 @@ module.exports = {
theme: path.join(__dirname, 'assets/css/_theme.scss'),
breakpoints: path.join(__dirname, 'assets/css/_breakpoints.scss'),
config: path.join(__dirname, `assets/js/config/${process.env.NODE_ENV || 'default'}.js`),
vue: 'vue/dist/vue.esm-bundler.js',
},
},
};