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,
[serie.name]: 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 serie = serieName && serieNames[slugify(serieName, '')];
console.log(release.title);
console.log(serieName);
if (serie) {
return {
channel: serie.slug,
title: release.title.replace(new RegExp(`${serieName}[\\s:-]*`), ''),
};
}
return null;
return serie?.slug || null;
// title: release.title.replace(new RegExp(`(${serieName}|${serie.name}|${serie.slug})[\\s:-]*`, 'i'), ''),
}
function scrapeAll(scenes, channel) {
@ -40,12 +36,14 @@ function scrapeAll(scenes, channel) {
release.title = query.cnt('.meta h3');
release.date = query.date('.meta .post-meta', 'MMMM D, YYYY');
release.poster = query.img('img');
return {
...release,
...matchChannel(release, channel),
release.poster = {
src: query.img('img'),
referer: channel.url,
};
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/"]'));
}
return {
...release,
...matchChannel(release, channel),
};
release.channel = matchChannel(release, channel);
return release;
}
async function fetchLatest(channel) {
// no apparent pagination, all updates on one page
// 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');
if (res.ok) {