Compare commits

..

No commits in common. "de7a8c756af294ce7fdf76172285b2b6a3fef9a9" and "523c36ecd4a91878ae8ac3e1a49e6842bd0e1251" have entirely different histories.

3 changed files with 15 additions and 31 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "traxxx", "name": "traxxx",
"version": "1.203.10", "version": "1.203.9",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "traxxx", "name": "traxxx",
"version": "1.203.10", "version": "1.203.9",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@casl/ability": "^5.2.2", "@casl/ability": "^5.2.2",

View File

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

View File

@ -24,19 +24,6 @@ function getApiUrl(appId, apiKey) {
}; };
} }
function getAvatarFallbacks(avatar) {
if (!avatar) {
return null;
}
return [
avatar.replace(/\d+x\d+/, '500x750'),
avatar.replace(/\d+x\d+/, '240x360'),
avatar.replace(/\d+x\d+/, '200x300'),
avatar,
];
}
async function fetchApiCredentials(referer, site) { async function fetchApiCredentials(referer, site) {
if (site?.parameters?.appId && site?.parameters?.apiKey) { if (site?.parameters?.appId && site?.parameters?.apiKey) {
return getApiUrl(site.parameters.appId, site.parameters.apiKey); return getApiUrl(site.parameters.appId, site.parameters.apiKey);
@ -463,8 +450,7 @@ async function fetchMovieTrailer(release) {
async function scrapeMovie({ query, el }, window, url, entity, options) { async function scrapeMovie({ query, el }, window, url, entity, options) {
const release = {}; const release = {};
const rawData = window.dataLayer[0]?.dvdDetails; const data = window.dataLayer[0]?.dvdDetails;
const data = rawData.dvdId && rawData; // dvdDetails is mostly empty in some cache states
release.entryId = new URL(url).pathname.match(/\/(\d+)(\/|$)/)?.[1]; release.entryId = new URL(url).pathname.match(/\/(\d+)(\/|$)/)?.[1];
@ -474,19 +460,12 @@ async function scrapeMovie({ query, el }, window, url, entity, options) {
]; ];
release.description = query.cnt('.descriptionText'); release.description = query.cnt('.descriptionText');
release.date = qu.extractDate(data?.dvdReleaseDate) || query.date('.updatedOn', 'YYYY-MM-DD'); release.date = qu.extractDate(data.dvdReleaseDate);
release.title = data?.dvdName || query.cnt('.dvdTitle'); release.title = data.dvdName;
release.director = query.el('.directedBy a', 'title');
release.actors = data?.dvdActors.map((actor) => ({ name: actor.actorName, entryId: actor.actorId }))
|| query.all('.actorCarousel a[href*="/pornstar"]').map((actorEl) => ({
entryId: query.url(actorEl, null).match(/\/(\d+)/)?.[1],
name: query.cnt(actorEl, 'span'),
href: query.url(actorEl, null, 'href', { origin: entity.url }),
avatar: getAvatarFallbacks(query.img(actorEl)),
}));
release.actors = data.dvdActors.map((actor) => ({ name: actor.actorName, entryId: actor.actorId }));
release.tags = query.cnts('.dvdCol a'); release.tags = query.cnts('.dvdCol a');
release.scenes = scrapeAll(qu.initAll(el, 'div[data-itemtype*=scene], li[data-itemtype*=scene]'), entity, entity.url); release.scenes = scrapeAll(qu.initAll(el, 'div[data-itemtype*=scene], li[data-itemtype*=scene]'), entity, entity.url);
if (options.includeTrailers) { if (options.includeTrailers) {
@ -531,7 +510,7 @@ async function fetchActorReleases(profileUrl, getActorReleasesUrl, page = 1, acc
} }
async function scrapeProfile({ query }, url, actorName, _siteSlug, getActorReleasesUrl, withReleases, context) { async function scrapeProfile({ query }, url, actorName, _siteSlug, getActorReleasesUrl, withReleases, context) {
const avatar = query.img('img.actorPicture'); const avatar = query.el('img.actorPicture');
const hair = query.cnt('.actorProfile .attribute_hair_color'); const hair = query.cnt('.actorProfile .attribute_hair_color');
const height = query.cnt('.actorProfile .attribute_height'); const height = query.cnt('.actorProfile .attribute_height');
const weight = query.cnt('.actorProfile .attribute_weight'); const weight = query.cnt('.actorProfile .attribute_weight');
@ -544,7 +523,12 @@ async function scrapeProfile({ query }, url, actorName, _siteSlug, getActorRelea
if (avatar) { if (avatar) {
// larger sizes usually available, provide fallbacks // larger sizes usually available, provide fallbacks
const avatars = getAvatarFallbacks(avatar); const avatars = [
avatar.src.replace(/\d+x\d+/, '500x750'),
avatar.src.replace(/\d+x\d+/, '240x360'),
avatar.src.replace(/\d+x\d+/, '200x300'),
avatar.src,
];
profile.avatar = avatars; profile.avatar = avatars;
} }