Compare commits

2 Commits
Author SHA1 Message Date
DebaucheryLibrarian 9f173d7aee 1.255.9 2026-07-26 17:59:39 +02:00
DebaucheryLibrarian 5f0320fde0 Handling inconsistent album data in Ricky's Room scraper. 2026-07-26 17:59:37 +02:00
3 changed files with 34 additions and 30 deletions
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "traxxx",
"version": "1.255.8",
"version": "1.255.9",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "traxxx",
"version": "1.255.8",
"version": "1.255.9",
"license": "ISC",
"dependencies": {
"@aws-sdk/client-s3": "^3.458.0",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "traxxx",
"version": "1.255.8",
"version": "1.255.9",
"description": "All the latest porn releases in one place",
"main": "src/app.js",
"scripts": {
+31 -27
View File
@@ -23,9 +23,13 @@ function scrapeScene(data, channel) {
release.tags = data.tags;
release.poster = [data.trailer_screencap].concat(data.extra_thumbnails);
release.photos = data.previews?.full
.map((url) => [url, url.replace('full/', 'thumbs/')]) // photos
.concat(data.thumbs); // screenshots
// inconsistent data structure. if there is an album, it's previews: { full: [...] }, if it's empty, it's previews: []
if (Array.isArray(data.previews?.full)) {
release.photos = data.previews?.full
.map((url) => [url, url.replace('full/', 'thumbs/')]) // photos
.concat(data.thumbs); // screenshots
}
release.trailer = data.trailer_url;
release.teaser = data.special_thumbnails;
@@ -36,30 +40,6 @@ function scrapeScene(data, channel) {
return release;
}
function scrapeProfile(data, scenes, entity) {
const profile = {};
profile.entryId = data.id;
profile.url = qu.prefixUrl(`/models/${data.slug}`, entity.url);
profile.description = data.Bio || data.bio;
profile.birthPlace = data.Born || data.born;
profile.dateOfBirth = qu.parseDate(data.Birthdate || data.birthdate, 'YYYY-MM-DD');
profile.measurements = data.Measurements || data.Measurements;
profile.height = feetInchesToCm(data.Height || data.height);
profile.weight = lbsToKg(data.Weight || data.weight);
profile.eyes = data.Eyes || data.eyes;
profile.hairColor = data.Hair || data.hair;
profile.avatar = data.thumb;
profile.scenes = scenes?.map((scene) => scrapeScene(scene, entity));
return profile;
}
async function fetchLatest(channel, page = 1) {
const url = `${channel.url}/videos?order_by=publish_date&per_page=100&page=${page}`; // unsure if page works, not enough videos as of 2022-05-29
const res = await qu.get(url);
@@ -102,6 +82,30 @@ async function fetchScene(url, channel, baseRelease) {
return res.status;
}
function scrapeProfile(data, scenes, entity) {
const profile = {};
profile.entryId = data.id;
profile.url = qu.prefixUrl(`/models/${data.slug}`, entity.url);
profile.description = data.Bio || data.bio;
profile.birthPlace = data.Born || data.born;
profile.dateOfBirth = qu.parseDate(data.Birthdate || data.birthdate, 'YYYY-MM-DD');
profile.measurements = data.Measurements || data.Measurements;
profile.height = feetInchesToCm(data.Height || data.height);
profile.weight = lbsToKg(data.Weight || data.weight);
profile.eyes = data.Eyes || data.eyes;
profile.hairColor = data.Hair || data.hair;
profile.avatar = data.thumb;
profile.scenes = scenes?.map((scene) => scrapeScene(scene, entity));
return profile;
}
async function fetchProfile({ slug }, entity) {
const url = `${entity.url}/models/${slug}`;
const res = await qu.get(url);