Compare commits

...

2 Commits

Author SHA1 Message Date
DebaucheryLibrarian
ee495a5cde 1.249.4 2026-02-24 01:18:22 +01:00
DebaucheryLibrarian
b52e871cfe Passing network channels as site scopes in Gamma API profile scraper. 2026-02-24 01:18:20 +01:00
4 changed files with 33 additions and 26 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "traxxx",
"version": "1.249.3",
"version": "1.249.4",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "traxxx",
"version": "1.249.3",
"version": "1.249.4",
"license": "ISC",
"dependencies": {
"@aws-sdk/client-s3": "^3.458.0",

View File

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

View File

@@ -886,7 +886,6 @@ const networks = [
layout: 'api',
sceneMovies: false,
actorScenes: 'https://www.xempire.com/en/videos/xempire/latest/{page}/All-Categories/0{actorPath}',
actorAvailableOnSites: ['allblackx', 'darkx', 'eroticax', 'hardx', 'lesbianx', 'xempire', 'xempirepartners'],
},
},
{

View File

@@ -716,27 +716,6 @@ async function scrapeProfile({ query }, url, actorName, _siteSlug, getActorRelea
return profile;
}
function scrapeApiProfile(data, releases, siteSlug) {
const profile = {};
if (data.male === 1) profile.gender = 'male';
if (data.female === 1) profile.gender = 'female';
if (data.shemale === 1 || data.trans === 1) profile.gender = 'transsexual';
if (data.description) profile.description = data.description.trim();
if (data.attributes.ethnicity) profile.ethnicity = data.attributes.ethnicity;
if (data.attributes.eye_color) profile.eyes = data.attributes.eye_color;
if (data.attributes.hair_color) profile.hairColor = data.attributes.hair_color;
const avatarPaths = Object.values(data.pictures).reverse();
if (avatarPaths.length > 0) profile.avatar = avatarPaths.map((avatarPath) => `https://images01-evilangel.gammacdn.com/actors${avatarPath}`);
if (releases) profile.releases = releases.map((release) => `https://${siteSlug}.com/en/video/${release.url_title}/${release.clip_id}`);
return profile;
}
async function fetchUpcomingApi(site, page = 1, options, preData) {
return fetchLatestApi(site, page, options, preData, true);
}
@@ -925,6 +904,27 @@ async function fetchProfile({ name: actorName }, context, include, altSearchUrl,
return null;
}
function scrapeApiProfile(data, releases, siteSlug) {
const profile = {};
if (data.male === 1) profile.gender = 'male';
if (data.female === 1) profile.gender = 'female';
if (data.shemale === 1 || data.trans === 1) profile.gender = 'transsexual';
if (data.description) profile.description = data.description.trim();
if (data.attributes.ethnicity) profile.ethnicity = data.attributes.ethnicity;
if (data.attributes.eye_color) profile.eyes = data.attributes.eye_color;
if (data.attributes.hair_color) profile.hairColor = data.attributes.hair_color;
const avatarPaths = Object.values(data.pictures).reverse();
if (avatarPaths.length > 0) profile.avatar = avatarPaths.map((avatarPath) => `https://images01-evilangel.gammacdn.com/actors${avatarPath}`);
if (releases) profile.releases = releases.map((release) => `https://${siteSlug}.com/en/video/${release.url_title}/${release.clip_id}`);
return profile;
}
async function fetchApiProfile({ name: actorName }, context, include) {
const siteSlug = context.entity.slug || context.site?.slug || context.network?.slug;
const actorSlug = encodeURI(actorName);
@@ -932,7 +932,13 @@ async function fetchApiProfile({ name: actorName }, context, include) {
const { apiUrl } = await fetchApiCredentials(referer);
const availableOnSites = (context.parameters.actorAvailableOnSites || [siteSlug]).map((site) => `"availableOnSite:${site}"`).join(',');
const availableOnSites = (context.parameters.actorAvailableOnSites
|| [
siteSlug,
...(context.entity.type === 'network'
? context.entity.children.map((networkChannel) => networkChannel.slug)
: []),
]).map((site) => `"availableOnSite:${site}"`).join(',');
const res = await http.post(apiUrl, {
requests: [
@@ -950,6 +956,8 @@ async function fetchApiProfile({ name: actorName }, context, include) {
encodeJSON: true,
});
console.log(res.status, res.body.results[0].hits[0]);
if (res.status === 200 && res.body.results[0].hits.length > 0) {
const actorData = res.body.results[0].hits.find((actor) => slugify(actor.name) === slugify(actorName));