Compare commits

..

No commits in common. "db14eaa5f918c8e09185d6c01c764de68aaff938" and "ed1bc6c73f1ef7f0ef472ca1727ebc5308cc3448" have entirely different histories.

3 changed files with 9 additions and 7 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "traxxx",
"version": "1.79.4",
"version": "1.79.3",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "traxxx",
"version": "1.79.4",
"version": "1.79.3",
"description": "All the latest porn releases in one place",
"main": "src/app.js",
"scripts": {

View File

@ -139,7 +139,7 @@ async function fetchActorReleases(url, accReleases = []) {
const releases = accReleases.concat(scrapeAll(document.body.outerHTML));
const nextPage = qu('.next-pg');
if (nextPage && new URL(nextPage).searchParams.has('page')) { // last page has 'next' button linking to join page
if (nextPage && new URL(nextPage).searchParams.has('page')) {
return fetchActorReleases(nextPage, releases);
}
@ -149,7 +149,7 @@ async function fetchActorReleases(url, accReleases = []) {
return null;
}
async function scrapeProfile(html, actorUrl) {
async function scrapeProfile(html) {
const { q, qa, qi } = ex(html, '#model-page');
const profile = { gender: 'female' };
@ -187,8 +187,10 @@ async function scrapeProfile(html, actorUrl) {
const avatar = qi('img');
if (avatar) profile.avatar = avatar;
const { origin, pathname } = new URL(actorUrl);
profile.releases = await fetchActorReleases(`${origin}${pathname}/scenes?page=1`);
const { qu } = ex(html, '#model-page + .container, #model-page + .container-fluid');
const releasesPage = qu('.next-pg');
if (releasesPage) profile.releases = await fetchActorReleases(releasesPage);
return profile;
}
@ -236,7 +238,7 @@ async function fetchProfile(actorName, scraperSlug, page = 1, source = 0) {
const actorRes = await bhttp.get(actorUrl);
if (actorRes.statusCode === 200) {
return scrapeProfile(actorRes.body.toString(), actorUrl);
return scrapeProfile(actorRes.body.toString());
}
return null;