Updated dependencies. Added periodic memory logger.
This commit is contained in:
@@ -15,7 +15,7 @@ const genderMap = {
|
||||
|
||||
function getPosterFallbacks(poster) {
|
||||
return poster
|
||||
.filter(image => /landscape/i.test(image.name))
|
||||
.filter((image) => /landscape/i.test(image.name))
|
||||
.sort((imageA, imageB) => imageB.height - imageA.height)
|
||||
.map((image) => {
|
||||
const sources = [image.src, image.highdpi?.['2x'], image.highdpi?.['3x']];
|
||||
@@ -23,7 +23,7 @@ function getPosterFallbacks(poster) {
|
||||
return image.height === 1080 ? sources : sources.reverse();
|
||||
})
|
||||
.flat()
|
||||
.map(src => ({
|
||||
.map((src) => ({
|
||||
src,
|
||||
expectType: {
|
||||
'binary/octet-stream': 'image/jpeg',
|
||||
@@ -33,8 +33,8 @@ function getPosterFallbacks(poster) {
|
||||
|
||||
function getTeaserFallbacks(teaser) {
|
||||
return teaser
|
||||
.filter(video => /landscape/i.test(video.name))
|
||||
.map(video => ({
|
||||
.filter((video) => /landscape/i.test(video.name))
|
||||
.map((video) => ({
|
||||
src: video.src,
|
||||
type: video.type,
|
||||
quality: Number(String(video.height).replace('353', '360')),
|
||||
@@ -44,7 +44,7 @@ function getTeaserFallbacks(teaser) {
|
||||
function getAvatarFallbacks(avatar) {
|
||||
return avatar
|
||||
.sort((imageA, imageB) => imageB.height - imageA.height)
|
||||
.map(image => [image.highdpi?.['3x'], image.highdpi?.['2x'], image.src])
|
||||
.map((image) => [image.highdpi?.['3x'], image.highdpi?.['2x'], image.src])
|
||||
.flat();
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ async function getPhotos(url) {
|
||||
});
|
||||
|
||||
const state = htmlRes?.window.__APOLLO_STATE__;
|
||||
const key = Object.values(state.ROOT_QUERY).find(query => query?.__ref)?.__ref;
|
||||
const key = Object.values(state.ROOT_QUERY).find((query) => query?.__ref)?.__ref;
|
||||
const data = state[key];
|
||||
|
||||
console.log(data);
|
||||
@@ -158,7 +158,7 @@ async function getPhotos(url) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return data.carousel.slice(1).map(photo => photo.main?.[0].src).filter(Boolean);
|
||||
return data.carousel.slice(1).map((photo) => photo.main?.[0].src).filter(Boolean);
|
||||
}
|
||||
|
||||
function scrapeAll(scenes, site, origin) {
|
||||
@@ -191,7 +191,7 @@ function scrapeUpcoming(scene, site) {
|
||||
release.title = scene.targetUrl
|
||||
.slice(1)
|
||||
.split('-')
|
||||
.map(component => `${component.charAt(0).toUpperCase()}${component.slice(1)}`)
|
||||
.map((component) => `${component.charAt(0).toUpperCase()}${component.slice(1)}`)
|
||||
.join(' ');
|
||||
|
||||
release.url = `${site.url}/videos${scene.targetUrl}`;
|
||||
@@ -243,7 +243,7 @@ async function scrapeScene(data, url, site, baseRelease, options) {
|
||||
const trailer = await getTrailer(scene, site, url);
|
||||
if (trailer) release.trailer = trailer;
|
||||
|
||||
release.chapters = data.video.chapters?.video.map(chapter => ({
|
||||
release.chapters = data.video.chapters?.video.map((chapter) => ({
|
||||
tags: [chapter.title],
|
||||
time: chapter.seconds,
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user