Compare commits

..

No commits in common. "971cda1cb5bc60c60db241b80d9490fccb52745d" and "5fc56308d2406e9bbb4b7c0456cfd473b2df6f97" have entirely different histories.

5 changed files with 18 additions and 49 deletions

2
package-lock.json generated
View File

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

View File

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

View File

@ -21,17 +21,9 @@ async function fetchScene(url, site) {
return release;
}
function getActorReleasesUrl(actorPath, page = 1) {
return `https://www.blowpass.com/en/videos/blowpass/latest/All-Categories/0${actorPath}/${page}`;
}
async function networkFetchProfile(actorName, siteSlug) {
return fetchProfile(actorName, siteSlug, null, getActorReleasesUrl);
}
module.exports = {
fetchLatest,
fetchProfile: networkFetchProfile,
fetchProfile,
fetchUpcoming,
fetchScene,
};

View File

@ -6,8 +6,7 @@ const { JSDOM } = require('jsdom');
const cheerio = require('cheerio');
const moment = require('moment');
const argv = require('../argv');
const { ex, get } = require('../utils/q');
const { ex } = require('../utils/q');
const slugify = require('../utils/slugify');
async function fetchPhotos(url) {
@ -110,7 +109,7 @@ async function scrapeApiReleases(json, site) {
});
}
function scrapeAll(html, site, networkUrl) {
function scrapeAll(html, site, useNetworkUrl) {
const $ = cheerio.load(html, { normalizeWhitespace: true });
const scenesElements = $('li[data-itemtype=scene]').toArray();
@ -119,9 +118,7 @@ function scrapeAll(html, site, networkUrl) {
const sceneLinkElement = $(element).find('.sceneTitle a');
if (site) release.url = `${networkUrl ? site.network.url : site.url}${sceneLinkElement.attr('href')}`;
else release.url = `${networkUrl}${sceneLinkElement.attr('href')}`;
release.url = `${useNetworkUrl ? site.network.url : site.url}${sceneLinkElement.attr('href')}`;
release.title = sceneLinkElement.attr('title');
release.entryId = $(element).attr('data-itemid');
@ -244,24 +241,7 @@ function scrapeActorSearch(html, url, actorName) {
return actorLink ? actorLink.href : null;
}
async function fetchActorReleases(profileUrl, getActorReleasesUrl, page = 1, accReleases = []) {
const { origin, pathname } = new URL(profileUrl);
const profilePath = `/${pathname.split('/').slice(-2).join('/')}`;
const url = getActorReleasesUrl(profilePath, page);
const { html, qu } = await get(url);
const releases = scrapeAll(html, null, origin);
const nextPage = qu('.Gamma_Paginator a.next');
if (nextPage) {
return fetchActorReleases(profileUrl, getActorReleasesUrl, page + 1, accReleases.concat(releases));
}
return accReleases.concat(releases);
}
async function scrapeProfile(html, url, actorName, _siteSlug, getActorReleasesUrl) {
function scrapeProfile(html, url, actorName, _siteSlug) {
const { q } = ex(html);
const avatar = q('img.actorPicture');
@ -295,9 +275,12 @@ async function scrapeProfile(html, url, actorName, _siteSlug, getActorReleasesUr
if (alias) profile.aliases = alias.split(':')[1].trim().split(', ');
if (nationality) profile.nationality = nationality.split(':')[1].trim();
if (getActorReleasesUrl && argv.withReleases) {
profile.releases = await fetchActorReleases(url, getActorReleasesUrl);
}
/* not fetching all releases
profile.releases = Array.from(document.querySelectorAll('.sceneList .scene a.imgLink'), el => `https://${siteSlug}.com${el.href}`);
const moreReleases = qu('.seeAllTop a');
console.log(moreReleases);
*/
return profile;
}
@ -382,6 +365,8 @@ async function fetchLatest(site, page = 1) {
const url = `${site.url}${site.parameters?.latest || '/en/videos/AllCategories/0/'}${page}`;
const res = await bhttp.get(url);
console.log(url);
return scrapeAll(res.body.toString(), site);
}
@ -420,7 +405,7 @@ async function fetchActorScenes(actorName, apiUrl, siteSlug) {
return [];
}
async function fetchProfile(actorName, siteSlug, altSearchUrl, getActorReleasesUrl) {
async function fetchProfile(actorName, siteSlug, altSearchUrl) {
const actorSlug = actorName.toLowerCase().replace(/\s+/, '+');
const searchUrl = altSearchUrl
? `https://www.${siteSlug}.com/en/search/${actorSlug}/1/actor`
@ -441,7 +426,7 @@ async function fetchProfile(actorName, siteSlug, altSearchUrl, getActorReleasesU
return null;
}
return scrapeProfile(actorRes.body.toString(), url, actorName, siteSlug, getActorReleasesUrl);
return scrapeProfile(actorRes.body.toString(), url, actorName, siteSlug);
}
return null;

View File

@ -19,17 +19,9 @@ async function fetchScene(url, site) {
return release;
}
function getActorReleasesUrl(actorPath, page = 1) {
return `https://www.xempire.com/en/videos/xempire/latest/${page}/All-Categories/0${actorPath}`;
}
async function networkFetchProfile(actorName, siteSlug) {
return fetchProfile(actorName, siteSlug, null, getActorReleasesUrl);
}
module.exports = {
fetchLatest,
fetchProfile: networkFetchProfile,
fetchProfile,
fetchUpcoming,
fetchScene,
};