From ac51382d8bbcbf23c964d20dc012f897a17803da Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Sun, 1 Sep 2024 21:44:48 +0200 Subject: [PATCH] Added upcoming to Porn World scraper. --- src/scrapers/pornworld.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/scrapers/pornworld.js b/src/scrapers/pornworld.js index 1d71fd29..aef1bee3 100755 --- a/src/scrapers/pornworld.js +++ b/src/scrapers/pornworld.js @@ -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, };