diff --git a/config/default.js b/config/default.js index 562025d38..474290cb3 100644 --- a/config/default.js +++ b/config/default.js @@ -179,7 +179,6 @@ module.exports = { 'gangbangcreampie', 'gloryholesecrets', 'aziani', - 'legalporno', [ 'firstanalquest', 'doubleviewcasting', @@ -188,6 +187,8 @@ module.exports = { 'silverstonedvd', 'silviasaint', ], + 'legalporno', + 'pierrewoodman', 'score', 'boobpedia', 'pornhub', diff --git a/public/img/logos/pierrewoodman/favicon.png b/public/img/logos/pierrewoodman/favicon.png new file mode 100644 index 000000000..68c076d04 Binary files /dev/null and b/public/img/logos/pierrewoodman/favicon.png differ diff --git a/public/img/logos/pierrewoodman/favicon_dark.png b/public/img/logos/pierrewoodman/favicon_dark.png new file mode 100644 index 000000000..eddce6655 Binary files /dev/null and b/public/img/logos/pierrewoodman/favicon_dark.png differ diff --git a/public/img/logos/pierrewoodman/favicon_light.png b/public/img/logos/pierrewoodman/favicon_light.png new file mode 100644 index 000000000..705d84334 Binary files /dev/null and b/public/img/logos/pierrewoodman/favicon_light.png differ diff --git a/public/img/logos/pierrewoodman/lazy/network.png b/public/img/logos/pierrewoodman/lazy/network.png new file mode 100644 index 000000000..cc85eaac3 Binary files /dev/null and b/public/img/logos/pierrewoodman/lazy/network.png differ diff --git a/public/img/logos/pierrewoodman/lazy/wakeupnfuck.png b/public/img/logos/pierrewoodman/lazy/wakeupnfuck.png new file mode 100644 index 000000000..3f6ab14e2 Binary files /dev/null and b/public/img/logos/pierrewoodman/lazy/wakeupnfuck.png differ diff --git a/public/img/logos/pierrewoodman/lazy/woodmancastingx.png b/public/img/logos/pierrewoodman/lazy/woodmancastingx.png new file mode 100644 index 000000000..4aadb70a8 Binary files /dev/null and b/public/img/logos/pierrewoodman/lazy/woodmancastingx.png differ diff --git a/public/img/logos/pierrewoodman/misc/spider.png b/public/img/logos/pierrewoodman/misc/spider.png new file mode 100644 index 000000000..2aa31a699 Binary files /dev/null and b/public/img/logos/pierrewoodman/misc/spider.png differ diff --git a/public/img/logos/pierrewoodman/misc/woodman-film-productions_splash.png b/public/img/logos/pierrewoodman/misc/woodman-film-productions_splash.png new file mode 100644 index 000000000..3eb136ef1 Binary files /dev/null and b/public/img/logos/pierrewoodman/misc/woodman-film-productions_splash.png differ diff --git a/public/img/logos/pierrewoodman/misc/woodman-film-productions_splash_transparent.png b/public/img/logos/pierrewoodman/misc/woodman-film-productions_splash_transparent.png new file mode 100644 index 000000000..991ba17cd Binary files /dev/null and b/public/img/logos/pierrewoodman/misc/woodman-film-productions_splash_transparent.png differ diff --git a/public/img/logos/pierrewoodman/network.png b/public/img/logos/pierrewoodman/network.png new file mode 100644 index 000000000..ebd039c2b Binary files /dev/null and b/public/img/logos/pierrewoodman/network.png differ diff --git a/public/img/logos/pierrewoodman/thumbs/network.png b/public/img/logos/pierrewoodman/thumbs/network.png new file mode 100644 index 000000000..95a261cee Binary files /dev/null and b/public/img/logos/pierrewoodman/thumbs/network.png differ diff --git a/public/img/logos/pierrewoodman/thumbs/wakeupnfuck.png b/public/img/logos/pierrewoodman/thumbs/wakeupnfuck.png new file mode 100644 index 000000000..64c0d801e Binary files /dev/null and b/public/img/logos/pierrewoodman/thumbs/wakeupnfuck.png differ diff --git a/public/img/logos/pierrewoodman/thumbs/woodmancastingx.png b/public/img/logos/pierrewoodman/thumbs/woodmancastingx.png new file mode 100644 index 000000000..5ae6b4af4 Binary files /dev/null and b/public/img/logos/pierrewoodman/thumbs/woodmancastingx.png differ diff --git a/public/img/logos/pierrewoodman/wakeupnfuck.png b/public/img/logos/pierrewoodman/wakeupnfuck.png new file mode 100644 index 000000000..c8f89755e Binary files /dev/null and b/public/img/logos/pierrewoodman/wakeupnfuck.png differ diff --git a/public/img/logos/pierrewoodman/woodmancastingx.png b/public/img/logos/pierrewoodman/woodmancastingx.png new file mode 100644 index 000000000..735cd49ec Binary files /dev/null and b/public/img/logos/pierrewoodman/woodmancastingx.png differ diff --git a/seeds/01_networks.js b/seeds/01_networks.js index 2372d3f74..fe6b28129 100644 --- a/seeds/01_networks.js +++ b/seeds/01_networks.js @@ -519,7 +519,7 @@ const networks = [ { slug: 'pierrewoodman', name: 'Pierre Woodman', - url: 'http://www.pierrewoodman.com', + url: 'http://www.woodmancastingx.com', }, { slug: 'xempire', diff --git a/src/scrapers/pierrewoodman.js b/src/scrapers/pierrewoodman.js new file mode 100644 index 000000000..2f51eb8ac --- /dev/null +++ b/src/scrapers/pierrewoodman.js @@ -0,0 +1,153 @@ +'use strict'; + +const qu = require('../utils/qu'); +const slugify = require('../utils/slugify'); +const capitalize = require('../utils/capitalize'); + +function removeImageBorder(source) { + if (!source) { + return null; + } + + const sourceNoId = source.replace(/_[a-z0-9]+(_v\d)?\.jpg/, '.jpg'); + + return [ + sourceNoId + .replace(/actoravatar_/, 'actoravatarnoborder_') + .replace(/scenedefault/, 'scenenoborder'), + sourceNoId, + source, + ]; +} + +function mapActor(actorEl, query, entity) { + const avatar = query.img(actorEl); + + return { + name: capitalize(query.cnt(actorEl, '.name, .informations p'), { uncapitalize: true }), + url: query.url(actorEl, null, 'href', { origin: entity.url }), + avatar: removeImageBorder(avatar), + }; +} + +function scrapeAll(scenes, channel, discard = true) { + return scenes.map(({ query, el }) => { + const release = {}; + + release.url = query.url(el, null, 'href', { origin: channel.url }); + const { hostname, pathname } = new URL(release.url); + + release.entryId = pathname.match(/_(\d+)/)?.[1]; + release.channel = hostname.match(/(\w+)\.com/)?.[1]; + + if (discard && release.channel !== channel.slug) { + return null; + } + + release.title = query.content('.title, .informations h3'); + release.duration = query.duration('.duration, .timer'); + + release.actors = query.cnt('.sub')?.split(/,\s*/); + + release.poster = removeImageBorder(query.img('.thumb, picture img')); + + return release; + }).filter(Boolean); +} + +function scrapeScene({ query, html }, url, entity) { + const release = {}; + + release.entryId = new URL(url).pathname.match(/_(\d+)/)?.[1]; + + const title = query.cnt('.page_title h1, h2'); + const wunfTitle = title.match(/wunf \d+/i)?.[0]; + + release.title = wunfTitle ? wunfTitle.toUpperCase() : title; + release.description = query.cnt('.info_container .description'); + + release.date = query.date('.info_container .info_line:nth-child(1)', 'YYYY-MM-DD') || query.date('.description', 'DD MMMM YYYY', /\d{1,2} \w+ \d{4}/); + release.actors = query.all('.girl_item, .starring .item').map(actorEl => mapActor(actorEl, query, entity)); + + release.duration = query.duration('.infos .description'); + + if (!release.duration) { + const duration = query.cnt('.info_container .info_line:nth-child(2)'); + + release.duration = (duration.match(/(\d+) hour/)?.[1] || 0) * 3600 + + (duration.match(/(\d+) minutes/)?.[1] || 0) * 60; + } + + release.tags = query.cnts('.tags a:not(.more_tag)'); + release.poster = removeImageBorder(html.match(/image: "(.*)"/)?.[1]); + + release.trailer = html.match(/url: "(.*mp4.*)"/g)?.map(src => ({ + src: src.match(/"(.*)"/)?.[1], + quality: Number(src.match(/[-/](\d+)p/)?.[1]), + })); + + return release; +} + +function scrapeProfile({ query }, entity) { + const profile = {}; + + profile.avatar = removeImageBorder(query.img('.actor img')); + profile.nationality = query.cnt('.nationality, .nationnality'); // sic + + profile.scenes = scrapeAll(qu.initAll(query.all('.videos .item')), entity, false); + + return profile; +} + +async function fetchLatest(channel, page) { + const res = await qu.getAll(channel.parameters?.latest + ? `${channel.parameters.latest}?page=${page}` + : `${channel.url}/videos?page=${page}`, '.items .scene'); + + if (res.ok) { + return scrapeAll(res.items, channel); + } + + return res.status; +} + +async function fetchProfile(baseActor, entity) { + const res = await qu.get('https://www.woodmancastingx.com'); + + if (!res.ok) { + return res.status; + } + + const searchUrl = qu.prefixUrl(res.html.match(/"(.*searchCompletion\.js)"/)?.[1], 'https://www.woodmancastingx.com'); + + if (!searchUrl) { + return null; + } + + const searchRes = await qu.get(searchUrl, null, null, { decodeJSON: true }); + + if (!searchRes.ok) { + return searchRes.status; + } + + const [actorId] = searchRes.body.actors.find(([_actorId, actorName]) => slugify(actorName) === baseActor.slug) || []; + + if (!actorId) { + return null; + } + + const actorRes = await qu.get(`https://www.woodmancastingx.com/search/redirection/actors/${actorId}`); + + if (actorRes.ok) { + return scrapeProfile(actorRes.item, entity); + } + + return actorRes.status; +} + +module.exports = { + fetchLatest, + scrapeScene, + fetchProfile, +}; diff --git a/src/scrapers/scrapers.js b/src/scrapers/scrapers.js index 362ad3ecd..1578ae376 100644 --- a/src/scrapers/scrapers.js +++ b/src/scrapers/scrapers.js @@ -255,6 +255,7 @@ const scrapers = { pervcity, pervertgallery: fullpornnetwork, peternorth: famedigital, + pierrewoodman, pimpxxx: cherrypimps, letsdoeit: porndoe, mamacitaz: porndoe,