Updated Kink scraper, added age gate cookie, fixed date query and trailer URL.

This commit is contained in:
DebaucheryLibrarian
2026-05-17 05:52:11 +02:00
parent ed3a7b57ec
commit 0756c93364
3 changed files with 29 additions and 10 deletions

View File

@@ -18,7 +18,7 @@ function scrapeAll(scenes, entity) {
release.entryId = release.shootId;
release.title = query.content('.card-body a[href*="/shoot"]').trim();
release.date = query.date('small > span', 'MMM D, YYYY');
release.date = query.date('.small > span', 'MMM D, YYYY');
release.actors = query.all('a[href*="/model"]').map((actorEl) => ({
name: unprint.query.content(actorEl),
@@ -54,7 +54,11 @@ function scrapeAll(scenes, entity) {
// no photos
}
release.trailer = `https://cdnp.kink.com/imagedb/${release.entryId}/trailer/${release.entryId}_trailer_high.mp4`;
release.trailer = [
query.video('.ratio-thumbnail img', { attribute: 'data-trailer-url' }),
`https://cdnp.kink.com/v2/imagedb/shoots/${release.entryId}/public/trailer/${release.entryId}_trailer_high.mp4`,
`https://cdnp.kink.com/imagedb/${release.entryId}/trailer/${release.entryId}_trailer_high.mp4`,
];
release.channel = slugify(query.content('.shoot-thumbnail-footer a[href*="/channel"]'), '');
release.rating = query.number('.thumb-up') / 10;
@@ -64,10 +68,13 @@ function scrapeAll(scenes, entity) {
}
async function fetchLatest(channel, page = 1) {
const url = `${channel.parent.url}/search?type=shoots&channelIds=${channel.parameters?.slug || channel.slug}&sort=published&page=${page}`;
const url = `${channel.parent.url}/shoots?channelIds=${channel.parameters?.slug || channel.slug}&sort=published&page=${page}`;
const res = await unprint.browser(url, {
selectAll: '.container .card',
cookies: {
age_gate_accepted: '1',
},
});
if (res.status === 200) {
@@ -129,6 +136,7 @@ function scrapeScene({ query }, url, entity) {
src: source.url,
quality: source.resolution,
})) || []),
`https://cdnp.kink.com/v2/imagedb/shoots/${release.entryId}/public/trailer/${release.entryId}_trailer_high.mp4`,
`https://cdnp.kink.com/imagedb/${release.entryId}/trailer/${release.entryId}_trailer_high.mp4`,
];
@@ -143,7 +151,11 @@ function scrapeScene({ query }, url, entity) {
}
async function fetchScene(url, channel) {
const res = await unprint.browser(url);
const res = await unprint.browser(url, {
cookies: {
age_gate_accepted: '1',
},
});
if (res.status === 200) {
const scene = scrapeScene(res.context, url, channel);
@@ -197,6 +209,9 @@ async function getActorUrl({ name: actorName, url }, networkUrl) {
// const searchRes = await tab.goto(`${networkUrl}/search?type=performers&q=${actorName}`);
const res = await unprint.get(`https://www.kink.com/api/v2/search/suggestions/performers?term=${actorName}`, {
interface: 'request',
cookies: {
age_gate_accepted: '1',
},
});
if (res.status === 200) {
@@ -217,7 +232,11 @@ async function fetchProfile(actor, entity) {
const actorUrl = await getActorUrl(actor, networkUrl);
if (actorUrl) {
const actorRes = await unprint.browser(actorUrl);
const actorRes = await unprint.browser(actorUrl, {
cookies: {
age_gate_accepted: '1',
},
});
if (actorRes.status === 200) {
return scrapeProfile(actorRes.context, actorUrl);