Compare commits

..

No commits in common. "eea74686c2493e62d2cb97ceda0ebba8d7c66730" and "eb759a0dec15e829a2ff213b4f16b6010e401d1b" have entirely different histories.

3 changed files with 17 additions and 24 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "traxxx", "name": "traxxx",
"version": "1.225.3", "version": "1.225.2",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "traxxx", "name": "traxxx",
"version": "1.225.3", "version": "1.225.2",
"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.225.3", "version": "1.225.2",
"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

@ -91,38 +91,29 @@ function scrapeScene({ query }, url, entity) {
return release; return release;
} }
async function fetchActorReleases(actorId, entity, page = 1, accReleases = []) { async function fetchActorReleases(actorUrl, page = 1, accReleases = []) {
const networkUrl = entity.type === 'channel' ? entity.parent.url : entity.url; const res = await qu.get(`${actorUrl}?page=${page}`);
const { tab } = await http.getBrowserSession('kink');
const res = await tab.goto(`${networkUrl}/search?type=shoots&performerIds=${actorId}&sort=published&page=${page}`);
if (res.status() === 200) { if (res.ok) {
const html = await tab.content(); const releases = scrapeAll(qu.initAll(res.item.el, '.shoot-list .shoot'));
const item = unprint.init(html); const hasNextPage = res.item.query.exists('.paginated-nav li:last-child:not(.disabled)');
const releases = scrapeAll(unprint.initAll(html, '.results .shoot-card'), entity);
const hasNextPage = item.query.exists('.paginated-nav li:last-child:not(.disabled)');
await tab.close();
if (hasNextPage) { if (hasNextPage) {
return fetchActorReleases(actorId, entity, page + 1, accReleases.concat(releases)); return fetchActorReleases(actorUrl, page + 1, accReleases.concat(releases));
} }
return accReleases.concat(releases); return accReleases.concat(releases);
} }
await tab.close();
return accReleases; return accReleases;
} }
async function scrapeProfile({ query }, actorUrl, entity, include) { async function scrapeProfile({ query }, actorUrl, include) {
const profile = {}; const profile = {};
profile.entryId = actorUrl.match(/\/model\/(\d+)\//)?.[1] || query.attribute('.favorite-button.bio-favorite', 'data-id'); profile.description = query.content('.bio #expand-text');
profile.description = query.content('.bio-outer #expand-text');
const tags = query.contents('.bio-tags a').map((tag) => tag.toLowerCase()); const tags = query.contents('.bio-tags a');
if (tags.includes('brunette') || tags.includes('brunet')) profile.hairColor = 'brown'; if (tags.includes('brunette') || tags.includes('brunet')) profile.hairColor = 'brown';
if (tags.includes('blonde') || tags.includes('blond')) profile.hairColor = 'blonde'; if (tags.includes('blonde') || tags.includes('blond')) profile.hairColor = 'blonde';
@ -147,10 +138,12 @@ async function scrapeProfile({ query }, actorUrl, entity, include) {
profile.avatar = query.img('.bio-slider-img, .bio-img:not([src*="Missing"])'); profile.avatar = query.img('.bio-slider-img, .bio-img:not([src*="Missing"])');
profile.social = query.urls('a.social-link'); profile.social = query.urls('a.social-link');
if (include.releases && profile.entryId) { if (include.releases) {
profile.releases = await fetchActorReleases(profile.entryId, entity); profile.releases = await fetchActorReleases(actorUrl);
} }
console.log(profile);
return profile; return profile;
} }
@ -222,7 +215,7 @@ async function fetchProfile({ name: actorName }, entity, options) {
await tab.close(); await tab.close();
return scrapeProfile(item, actorUrl, entity, options); return scrapeProfile(item, actorUrl, options);
} }
await tab.close(); await tab.close();