From 8aeee8eea6e81e68a1ad6aff53d0e4a701f75e47 Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Wed, 21 Aug 2024 01:03:53 +0200 Subject: [PATCH] Added Cliff Media (Vanessa Cliff). --- seeds/02_sites.js | 7 ++++ src/scrapers/cliffmedia.js | 67 ++++++++++++++++++++++++++++++++++++++ src/scrapers/scrapers.js | 2 ++ src/scrapers/template.js | 14 ++------ 4 files changed, 78 insertions(+), 12 deletions(-) create mode 100644 src/scrapers/cliffmedia.js diff --git a/seeds/02_sites.js b/seeds/02_sites.js index b76da972..6d29c50d 100755 --- a/seeds/02_sites.js +++ b/seeds/02_sites.js @@ -2548,6 +2548,13 @@ const sites = [ extract: true, }, }, + // CLIFF MEDIA / VANESSA CLIFF + { + name: 'Cliff Media', + slug: 'cliffmedia', + alias: ['vanessa cliff'], + url: 'https://www.vanessacliff.com', + }, // CZECHAV { name: 'Czech Streets', diff --git a/src/scrapers/cliffmedia.js b/src/scrapers/cliffmedia.js new file mode 100644 index 00000000..5886731e --- /dev/null +++ b/src/scrapers/cliffmedia.js @@ -0,0 +1,67 @@ +'use strict'; + +const unprint = require('unprint'); + +function scrapeAll(scenes) { + return scenes.map(({ query }) => { + const release = {}; + + release.url = query.url('.image-container a'); + release.entryId = new URL(release.url).pathname.match(/\/video-preview\/(\w+)/)[1]; + + release.title = query.content('.caption-title'); + + release.poster = query.img('.image-container img'); + + return release; + }); +} + +function scrapeScene({ query }, { url }) { + const release = {}; + + release.entryId = new URL(url).pathname.match(/\/video-preview\/(\w+)/)[1]; + + release.title = query.content('#dm_content .dmNewParagraph[data-diy-text]'); + + release.poster = query.poster('#dm_content video'); + release.trailer = query.video('#dm_content video source'); + + return release; +} + +async function fetchScene(url) { + const res = await unprint.get(url, { + headers: { + Accept: '*/*', // seems to respond with JSON otherwise + }, + }); + + if (res.ok) { + return scrapeScene(res.context, { url }); + } + + return res.status; +} + +async function fetchLatest(channel) { + const url = `${channel.url}/free-video`; // no pagination at this time + + const res = await unprint.get(url, { + selectAll: '.gallery .photoGalleryThumbs', + headers: { + Accept: '*/*', // seems to respond with JSON otherwise + }, + }); + + if (res.ok) { + return scrapeAll(res.context, channel); + } + + return res.status; +} + +module.exports = { + fetchLatest, + fetchScene, +}; diff --git a/src/scrapers/scrapers.js b/src/scrapers/scrapers.js index d7e1b6ab..c1e24921 100755 --- a/src/scrapers/scrapers.js +++ b/src/scrapers/scrapers.js @@ -12,6 +12,7 @@ const bang = require('./bang'); const bangbros = require('./bangbros'); const bradmontana = require('./bradmontana'); const cherrypimps = require('./cherrypimps'); +const cliffmedia = require('./cliffmedia'); const cumlouder = require('./cumlouder'); const czechav = require('./czechav'); const ddfnetwork = require('./ddfnetwork'); @@ -96,6 +97,7 @@ const scrapers = { bradmontana, brazzers: aylo, cherrypimps, + cliffmedia, cumlouder, czechav, pornworld: ddfnetwork, diff --git a/src/scrapers/template.js b/src/scrapers/template.js index 133f2a7d..15e94554 100755 --- a/src/scrapers/template.js +++ b/src/scrapers/template.js @@ -28,7 +28,7 @@ function scrapeAll(scenes) { }); } -function scrapeScene({ query }, url) { +function scrapeScene({ query }, { url }) { const release = {}; release.entryId = new URL(url).pathname.match(/\/scene\/(\d+)/)[1]; @@ -70,16 +70,6 @@ async function fetchLatest(channel, page = 1) { return res.status; } -async function fetchScene(url, channel) { - const res = await unprint.get(url); - - if (res.ok) { - return scrapeScene(res.context, url, channel); - } - - return res.status; -} - async function fetchProfile({ name: actorName }, entity, include) { const url = `${entity.url}/actors/${slugify(actorName, '_')}`; const res = await unprint.get(url); @@ -93,6 +83,6 @@ async function fetchProfile({ name: actorName }, entity, include) { module.exports = { fetchLatest, - fetchScene, fetchProfile, + scrapeScene, };