Automatically linking VR scenes to NaughtyAmericaVR.com.
This commit is contained in:
parent
b72bb39ff7
commit
2a12f5ca1d
|
|
@ -10,7 +10,6 @@ function scrapeLatest(scenes, channel) {
|
||||||
const release = {};
|
const release = {};
|
||||||
const url = query.url('a');
|
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.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');
|
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'), '');
|
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;
|
return release;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -124,7 +128,8 @@ function scrapeScene({ query }, { url }) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function fetchScene(url, _channel) {
|
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) {
|
async control(ctx) {
|
||||||
await ctx.locator('.scene-info, .scene').first().hover({ trial: true, timeout: 30000 }); // wait for trailer to initialize
|
await ctx.locator('.scene-info, .scene').first().hover({ trial: true, timeout: 30000 }); // wait for trailer to initialize
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue