diff --git a/assets/components/actors/actor.vue b/assets/components/actors/actor.vue index d0d0ac38..ca2a02ce 100644 --- a/assets/components/actors/actor.vue +++ b/assets/components/actors/actor.vue @@ -402,9 +402,9 @@ function showAlbum() { } async function watchRoute(to, from) { - if (to.params.pageNumber !== from.params.pageNumber) { - await this.fetchActor(); - } + console.log(to, from); + + await this.fetchActor(); } async function mounted() { diff --git a/public/img/tags/bts/3.jpeg b/public/img/tags/bts/3.jpeg new file mode 100644 index 00000000..f3434f7e Binary files /dev/null and b/public/img/tags/bts/3.jpeg differ diff --git a/public/img/tags/bts/3b.jpeg b/public/img/tags/bts/3b.jpeg new file mode 100644 index 00000000..72ac3a18 Binary files /dev/null and b/public/img/tags/bts/3b.jpeg differ diff --git a/public/img/tags/bts/lazy/3.jpeg b/public/img/tags/bts/lazy/3.jpeg new file mode 100644 index 00000000..319e921d Binary files /dev/null and b/public/img/tags/bts/lazy/3.jpeg differ diff --git a/public/img/tags/bts/lazy/3b.jpeg b/public/img/tags/bts/lazy/3b.jpeg new file mode 100644 index 00000000..6e190fea Binary files /dev/null and b/public/img/tags/bts/lazy/3b.jpeg differ diff --git a/public/img/tags/bts/originals/3.jpeg b/public/img/tags/bts/originals/3.jpeg new file mode 100644 index 00000000..8e90ec6e Binary files /dev/null and b/public/img/tags/bts/originals/3.jpeg differ diff --git a/public/img/tags/bts/originals/3b.jpeg b/public/img/tags/bts/originals/3b.jpeg new file mode 100644 index 00000000..9f5d6797 Binary files /dev/null and b/public/img/tags/bts/originals/3b.jpeg differ diff --git a/public/img/tags/bts/thumbs/3.jpeg b/public/img/tags/bts/thumbs/3.jpeg new file mode 100644 index 00000000..05850b6f Binary files /dev/null and b/public/img/tags/bts/thumbs/3.jpeg differ diff --git a/public/img/tags/bts/thumbs/3b.jpeg b/public/img/tags/bts/thumbs/3b.jpeg new file mode 100644 index 00000000..cb7b3da6 Binary files /dev/null and b/public/img/tags/bts/thumbs/3b.jpeg differ diff --git a/seeds/04_media.js b/seeds/04_media.js index dd670956..f166ddbe 100644 --- a/seeds/04_media.js +++ b/seeds/04_media.js @@ -597,7 +597,7 @@ const tagPosters = [ ['atm', 2, 'Jureka Del Mar in "Stretched Out" for Her Limit'], ['atogm', 0, 'Alysa Gap and Logan in "Anal Buffet 4" for Evil Angel'], ['bdsm', 0, 'Dani Daniels in "The Traning of Dani Daniels, Day 2" for The Training of O at Kink'], - ['bts', 2, 'Christy Mack for Digital Playground'], + ['bts', '3b', 'Brenna Sparks for Bang! Confessions'], ['blindfold', 0, 'Kylie Page in "Natural Blindfolded Beauties" for Hustler'], ['blonde', 1, 'Marsha May in "Once You Go Black 7" for Jules Jordan'], ['blowbang', 0, 'Lacy Lennon in "Lacy Lennon\'s First Blowbang" for HardX'], @@ -717,6 +717,7 @@ const tagPhotos = [ ['anal-fingering', 2, 'Aidra Fox and Cassidy Klein in "Lesbian Anal Yoga" for LesbianX'], ['bts', 0, 'Janice Griffith in "Day With A Pornstar: Janice" for Brazzers'], ['bts', 1, 'Madison Ivy in "Day With A Pornstar" for Brazzers'], + ['bts', 2, 'Christy Mack for Digital Playground'], ['blonde', 4, 'Marry Queen for Babespotting.tv'], ['blonde', 3, 'Kylie Page in "A Juicy Afternoon Delight" for New Sensations'], ['blonde', 2, 'Isabelle Deltore for Her Limit'], diff --git a/src/argv.js b/src/argv.js index 6b282435..ac04f296 100644 --- a/src/argv.js +++ b/src/argv.js @@ -146,7 +146,7 @@ const { argv } = yargs describe: 'Limit amount of scenes when dates are missing.', type: 'number', default: config.missingDateLimit, - alias: ['null-date-limit', 'limit'], + alias: ['null-date-limit'], }) .option('page', { describe: 'Page to start scraping at', diff --git a/src/scrapers/bang.js b/src/scrapers/bang.js index 6ce81297..8d075cb1 100644 --- a/src/scrapers/bang.js +++ b/src/scrapers/bang.js @@ -1,6 +1,7 @@ 'use strict'; const http = require('../utils/http'); +const qu = require('../utils/qu'); const { extractDate } = require('../utils/qu'); const { inchesToCm } = require('../utils/convert'); const slugify = require('../utils/slugify'); @@ -37,7 +38,23 @@ function decodeId(id) { .toString('hex'); } -function scrapeScene(scene) { +async function fetchPhotos(scene) { + const photoPaths = Array.from({ length: scene.photos }, (value, index) => `/${scene.dvd.id}/${scene.identifier}/final/${String(index + 1).padStart(6, '0')}.jpg`); + + const res = await http.post('https://www.bang.com/sign-images', { + images: photoPaths, + }, { + encodeJSON: false, + }); + + if (res.ok) { + return res.body.images.map(image => qu.prefixUrl(image, 'https://photos.bang.com')); + } + + return null; +} + +async function scrapeScene(scene, entity, options) { const release = { entryId: scene.id, title: scene.name, @@ -58,17 +75,23 @@ function scrapeScene(scene) { if (scene.gay) release.tags.push('gay'); const defaultPoster = scene.screenshots.find(photo => photo.default === true); - const photoset = scene.screenshots.filter(photo => photo.default === false); + const screens = scene.screenshots.filter(photo => photo.default === false); - const photos = defaultPoster ? photoset : photoset.slice(1); - const poster = defaultPoster || photoset[0]; + const remainingScreens = defaultPoster ? screens : screens.slice(1); + const poster = defaultPoster || screens[0]; release.poster = getScreenUrl(poster, scene); - release.photos = photos.map(photo => getScreenUrl(photo, scene)); + release.photos = remainingScreens.map(photo => getScreenUrl(photo, scene)); - release.trailer = { - src: `https://i.bang.com/v/${scene.dvd.id}/${scene.identifier}/preview.mp4`, - }; + if (options.includePhotos) { + const photos = await fetchPhotos(scene); + + if (photos?.length > 0) { + release.photos = photos; + } + } + + release.trailer = `https://i.bang.com/v/${scene.dvd.id}/${scene.identifier}/preview.mp4`; release.channel = scene.series.name .replace(/[! .]/g, '') @@ -328,7 +351,7 @@ async function fetchUpcoming(site, page = 1) { return scrapeAll(res.body.hits.hits, site); } -async function fetchScene(url) { +async function fetchScene(url, entity, baseRelease, options) { const encodedId = new URL(url).pathname.split('/')[2]; const entryId = decodeId(encodedId); @@ -338,7 +361,7 @@ async function fetchScene(url) { }, }); - return scrapeScene(res.body._source); // eslint-disable-line no-underscore-dangle + return scrapeScene(res.body._source, entity, options); // eslint-disable-line no-underscore-dangle } async function fetchProfile({ name: actorName }, context, include) {