Automatically linking VR scenes to NaughtyAmericaVR.com.

This commit is contained in:
DebaucheryLibrarian 2026-01-23 02:34:37 +01:00
parent b72bb39ff7
commit 2a12f5ca1d
1 changed files with 7 additions and 2 deletions

View File

@ -10,7 +10,6 @@ function scrapeLatest(scenes, channel) {
const release = {};
const url = query.url('a');
release.url = url;
release.entryId = query.attribute('a', 'data-scene-id') || (url && new URL(url).pathname.match(/-(\d+)$/)?.[1]) || null;
release.date = query.date('.entry-date, .scene-date', 'MMM D, YYYY');
@ -43,6 +42,11 @@ function scrapeLatest(scenes, channel) {
release.channel = slugify(query.content('.site-title'), '');
// NA affiliate prefers to push more traffic to Naughty America VR, all scenes labeled VR seem to be available on NAVR
release.url = release.tags?.some((tag) => tag.toLowerCase() === 'vr')
? url.replace('naughtyamerica.com', 'naughtyamericavr.com')
: url;
return release;
});
}
@ -124,7 +128,8 @@ function scrapeScene({ query }, { url }) {
}
async function fetchScene(url, _channel) {
const res = await unprint.browserRequest(url, {
// latest set NaughtyAmericaVR URL, but try deep scrape from regular NA website
const res = await unprint.browserRequest(url.replace('naughtyamericavr.com', 'naughtyamerica.com'), {
async control(ctx) {
await ctx.locator('.scene-info, .scene').first().hover({ trial: true, timeout: 30000 }); // wait for trailer to initialize
},