Added periodic memory logger.
This commit is contained in:
@@ -17,21 +17,21 @@ function extractMaleModelsFromTags(tagContainer) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const tagEls = Array.from(tagContainer.childNodes, node => ({ type: node.nodeType, text: node.textContent.trim() })).filter(node => node.text.length > 0);
|
||||
const modelLabelIndex = tagEls.findIndex(node => node.text === 'Male Models');
|
||||
const tagEls = Array.from(tagContainer.childNodes, (node) => ({ type: node.nodeType, text: node.textContent.trim() })).filter((node) => node.text.length > 0);
|
||||
const modelLabelIndex = tagEls.findIndex((node) => node.text === 'Male Models');
|
||||
|
||||
if (modelLabelIndex > -1) {
|
||||
const nextLabelIndex = tagEls.findIndex((node, index) => index > modelLabelIndex && node.type === 3);
|
||||
const maleModels = tagEls.slice(modelLabelIndex + 1, nextLabelIndex);
|
||||
|
||||
return maleModels.map(model => model.text);
|
||||
return maleModels.map((model) => model.text);
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
async function extractChannelFromPhoto(photo, channel) {
|
||||
const siteSlugs = (channel.type === 'network' ? channel.children : channel.parent?.children)?.map(child => child.slug);
|
||||
const siteSlugs = (channel.type === 'network' ? channel.children : channel.parent?.children)?.map((child) => child.slug);
|
||||
const channelMatch = photo.match(new RegExp(siteSlugs.join('|')));
|
||||
|
||||
if (channelMatch) {
|
||||
@@ -52,7 +52,7 @@ async function scrapeLatest(scenes, site) {
|
||||
const slug = new URL(release.url).pathname.split('/')[2];
|
||||
release.entryId = getHash(`${site.slug}${slug}${release.date.toISOString()}`);
|
||||
|
||||
release.actors = release.title.split('&').map(actor => actor.trim());
|
||||
release.actors = release.title.split('&').map((actor) => actor.trim());
|
||||
|
||||
[release.poster, ...release.photos] = query.imgs('.bloc-link img');
|
||||
|
||||
@@ -78,7 +78,7 @@ async function scrapeScene({ query }, site, url) {
|
||||
const uhd = query.cnt('#video-ribbon .container > div > span:nth-child(2)');
|
||||
if (/4K/.test(uhd)) release.tags = release.tags.concat('4k');
|
||||
|
||||
release.photos = query.all('.bxslider_pics img').map(el => el.dataset.original || el.src);
|
||||
release.photos = query.all('.bxslider_pics img').map((el) => el.dataset.original || el.src);
|
||||
release.poster = query.poster();
|
||||
|
||||
const trailer = query.trailer();
|
||||
|
||||
Reference in New Issue
Block a user