Added 'clear all' button to tag filter. Tag name never removes tag. Added actor scene scraping to LegalPorno.

This commit is contained in:
DebaucheryLibrarian
2020-07-19 19:40:21 +02:00
parent 70bf00e844
commit 5291a87587
24 changed files with 111 additions and 71 deletions

View File

@@ -42,7 +42,7 @@ function getPoster(posterElement, sceneId) {
return `https://legalporno.com/casting/${sceneId}/${posterTime}`;
}
function scrapeLatest(html, site) {
function scrapeAll(html) {
const $ = cheerio.load(html, { normalizeWhitespace: true });
const scenesElements = $('.thumbnails > div').toArray();
@@ -68,7 +68,6 @@ function scrapeLatest(html, site) {
title,
date,
poster,
site,
};
});
}
@@ -111,13 +110,6 @@ async function scrapeScene(html, url, site, useGallery) {
const { origin, pathname } = new URL(source);
return `${origin}${pathname}`;
/* disable thumbnail as fallback, usually enough high res photos available
return [
`${origin}${pathname}`,
source,
];
*/
});
const posterStyle = $('#player').attr('style');
@@ -165,13 +157,15 @@ async function scrapeProfile(html, _url, actorName) {
if (bio.Age) profile.age = bio.Age;
if (avatarEl) profile.avatar = avatarEl.src;
profile.releases = scrapeAll(html);
return profile;
}
async function fetchLatest(site, page = 1) {
const res = await bhttp.get(`${site.url}/new-videos/${page}`);
return scrapeLatest(res.body.toString(), site);
return scrapeAll(res.body.toString(), site);
}
async function fetchScene(url, site) {