Updated Kink affiliates, WIP Blue Donkey (Meiden van Holland) refactor.

This commit is contained in:
DebaucheryLibrarian
2026-01-28 01:16:02 +01:00
parent 950048df9a
commit a5fda3e0e9
3 changed files with 66 additions and 26 deletions

View File

@@ -35,6 +35,7 @@ function scrapeAll(scenes, channel, context) {
return scenes.reduce((acc, scene) => {
const release = {};
/*
release.entryId = scene.id;
release.url = getSceneUrl(channel, scene.attributes.slug, scene.id);
release.date = unprint.extractDate(scene.attributes.product.active_from, 'D/M/YY');
@@ -50,10 +51,6 @@ function scrapeAll(scenes, channel, context) {
release.poster = `https://cdndo.sysero.nl${scene.attributes.images.thumb?.[0]?.path || context.images[scene.id]}`;
}
if (scene.attributes.videos.trailer?.[0]) {
release.trailer = async () => fetchTrailer(scene.id, scene.attributes.videos.trailer[0].id, channel, context.credentials);
}
if (teaserPath) {
release.teaser = `https://cdndo.sysero.nl${teaserPath}`;
}
@@ -65,6 +62,10 @@ function scrapeAll(scenes, channel, context) {
// all MVH sites list the entire network, but we want to store Flemish scenes under Vurig Vlaanderen
return { ...acc, unextracted: [...acc.unextracted, release] };
}
*/
console.log(scene);
console.log(release);
return { ...acc, scenes: [...acc.scenes, release] };
}, {
@@ -73,6 +74,22 @@ function scrapeAll(scenes, channel, context) {
});
}
async function fetchLatest(channel, page, context) {
// query seems to break if any component is left out or even moved
const res = await http.get(`https://apiv2.sysero.nl/api${context.parameters.apiPath}/resources/nl?query=(content:videos,types:(0:video),sort:(published_at:DESC),filters:(active:1,status:published),pagination:(page:${page},per_page:20),include:((resources:(filters:((types:(0:category),status:published)),images:(filters:((types:(0:thumb))))),images:(filters:((types:(0:cover,1:home_cover,2:thumb,3:cover_thumb)))),clips:(),videos:(),categories:())))`, {
headers: {
Origin: channel.origin,
Credentials: context.parameters.credentials,
},
});
if (res.ok && res.body.data) {
return scrapeAll(res.body.data, channel, context);
}
return res.status;
}
function getCredentials(channel) {
const now = Math.floor(Date.now() / 1000);
@@ -181,27 +198,6 @@ function scrapeScene({ _query, window }, context) {
return null;
}
async function fetchLatest(channel, page, context) {
const credentials = getCredentials(channel);
const res = await http.get(`https://api.sysero.nl/videos?page=${page}&count=20&type=video&include=images:types(thumb|thumb_mobile),categories,clips&filter[status]=published&filter[products]=1%2C2&sort[published_at]=DESC&frontend=${channel.parameters.frontend}`, {
headers: {
Origin: channel.url,
Credentials: credentials,
},
});
if (res.ok && res.body.data) {
const tags = Object.fromEntries(res.body.included?.filter((item) => item.type === 'category').map((item) => [item.id, item.attributes.slug]) || []);
const images = Object.fromEntries(res.body.included?.filter((item) => item.type === 'image' && item.attributes.types === 'thumb').map((item) => [item.id, item.attributes.path]) || []);
const clips = Object.fromEntries(res.body.included?.filter((item) => item.type === 'clip').map((item) => [item.id, item.attributes.path]) || []);
return scrapeAll(res.body.data, channel, { ...context, images, clips, tags, credentials });
}
return res.status;
}
async function fetchProfile(actor, { entity }) {
const credentials = getCredentials(entity);
const url = `${entity.url}/modellen/${actor.slug}`;