forked from DebaucheryLibrarian/traxxx
Getting more and higher quality Vixen photos.
This commit is contained in:
parent
67c1e6c556
commit
4e4323704a
|
@ -43,6 +43,7 @@ module.exports = {
|
|||
media: {
|
||||
path: './',
|
||||
thumbnailSize: 320, // width for 16:9 will be exactly 576px
|
||||
thumbnailQuality: 90,
|
||||
limit: 25, // max number of photos per release
|
||||
},
|
||||
};
|
||||
|
|
|
@ -43,7 +43,7 @@ async function createThumbnail(buffer) {
|
|||
withoutEnlargement: true,
|
||||
})
|
||||
.jpeg({
|
||||
quality: 75,
|
||||
quality: config.media.thumbnailQuality,
|
||||
})
|
||||
.toBuffer();
|
||||
}
|
||||
|
|
|
@ -60,15 +60,16 @@ function scrapeLatest(html, site) {
|
|||
|
||||
async function scrapeScene(html, url, site) {
|
||||
const $ = cheerio.load(html, { normalizeWhitespace: true });
|
||||
const { pathname, search } = new URL(url);
|
||||
|
||||
const stateObject = $('script:contains("INITIAL_STATE")');
|
||||
const data = JSON.parse(stateObject.html().trim().slice(27, -1));
|
||||
|
||||
const entryId = data.page.data[`${pathname}${search}`].data.video;
|
||||
const pageData = data.page.data[data.location.pathname].data;
|
||||
const entryId = pageData.video;
|
||||
const scene = data.videos.find(video => video.newId === entryId);
|
||||
|
||||
const [poster, ...photos] = scene.rotatingThumbsUrlSizes.map(photo => photo['1040w']);
|
||||
const poster = scene.rotatingThumbsUrlSizes[0]['1040w'];
|
||||
const photos = pageData.pictureset.map(photo => photo.main[0].src);
|
||||
const trailer = scene.previews.listing.find(preview => preview.height === 353) || null;
|
||||
|
||||
const {
|
||||
|
|
Loading…
Reference in New Issue