Added upcoming to Porn World scraper.

This commit is contained in:
DebaucheryLibrarian 2024-09-01 21:44:48 +02:00
parent a740c8b046
commit ac51382d8b
1 changed files with 13 additions and 1 deletions

View File

@ -11,7 +11,7 @@ function scrapeAll(scenes) {
release.title = query.content('.card-title a');
release.date = query.date('.release-date', 'YYYY MMMM, DD', { match: /\d{4} \w+, \d{1,2}/i });
release.date = query.date('.release-date, .coming-soon-date', 'YYYY MMMM, DD', { match: /\d{4} \w+, \d{1,2}/i });
release.duration = query.duration('.video-duration');
release.actors = query.all('.starring a').map((actorEl) => ({
@ -82,6 +82,17 @@ async function fetchLatest(channel, page = 1) {
return res.status;
}
async function fetchUpcoming(channel) {
const url = `${channel.url}/coming-soon`;
const res = await unprint.get(url, { selectAll: '.card.scene' });
if (res.ok) {
return scrapeAll(res.context, channel);
}
return res.status;
}
async function fetchProfile({ name: actorName }, entity) {
const searchUrl = `${entity.url}/models?name=${actorName}&sort=popularity`;
const searchRes = await unprint.get(searchUrl);
@ -108,6 +119,7 @@ async function fetchProfile({ name: actorName }, entity) {
module.exports = {
fetchLatest,
fetchUpcoming,
fetchProfile,
scrapeScene,
};