Added channel matching to Little Caprice Dreams.

This commit is contained in:
DebaucheryLibrarian 2020-11-27 03:23:12 +01:00
parent 60485751e2
commit 9a183c7ffb
1 changed files with 21 additions and 23 deletions

View File

@ -10,24 +10,20 @@ function matchChannel(release, channel) {
...acc, ...acc,
[serie.name]: serie, [serie.name]: serie,
[serie.slug]: serie, [serie.slug]: serie,
}), { }), {});
vr: 'littlecapricevr',
}); serieNames.vr = serieNames.littlecapricevr;
serieNames.superprivat = serieNames.superprivatex;
serieNames.superprivate = serieNames.superprivatex;
serieNames.nasst = serieNames.nassty;
serieNames.sexlesson = serieNames.sexlessons;
serieNames['sex lesson'] = serieNames.sexlessons;
const serieName = release.title.match(new RegExp(Object.keys(serieNames).join('|'), 'i'))?.[0]; const serieName = release.title.match(new RegExp(Object.keys(serieNames).join('|'), 'i'))?.[0];
const serie = serieName && serieNames[slugify(serieName, '')]; const serie = serieName && serieNames[slugify(serieName, '')];
console.log(release.title); return serie?.slug || null;
console.log(serieName); // title: release.title.replace(new RegExp(`(${serieName}|${serie.name}|${serie.slug})[\\s:-]*`, 'i'), ''),
if (serie) {
return {
channel: serie.slug,
title: release.title.replace(new RegExp(`${serieName}[\\s:-]*`), ''),
};
}
return null;
} }
function scrapeAll(scenes, channel) { function scrapeAll(scenes, channel) {
@ -40,12 +36,14 @@ function scrapeAll(scenes, channel) {
release.title = query.cnt('.meta h3'); release.title = query.cnt('.meta h3');
release.date = query.date('.meta .post-meta', 'MMMM D, YYYY'); release.date = query.date('.meta .post-meta', 'MMMM D, YYYY');
release.poster = query.img('img'); release.poster = {
src: query.img('img'),
return { referer: channel.url,
...release,
...matchChannel(release, channel),
}; };
release.channel = matchChannel(release, channel);
return release;
}); });
} }
@ -102,15 +100,15 @@ async function scrapeScene({ query }, url, channel, include) {
release.photos = await fetchPhotos(query.url('.vid_buttons a[href*="project/"]')); release.photos = await fetchPhotos(query.url('.vid_buttons a[href*="project/"]'));
} }
return { release.channel = matchChannel(release, channel);
...release,
...matchChannel(release, channel), return release;
};
} }
async function fetchLatest(channel) { async function fetchLatest(channel) {
// no apparent pagination, all updates on one page // no apparent pagination, all updates on one page
// using channels in part because main overview contains indistinguishable photo albums // using channels in part because main overview contains indistinguishable photo albums
// however, some serie pages contain videos from other series
const res = await qu.getAll(channel.url, '.project'); const res = await qu.getAll(channel.url, '.project');
if (res.ok) { if (res.ok) {