Fixed release actor origin bug.
This commit is contained in:
@@ -67,12 +67,14 @@ async function curateRelease(release) {
|
||||
birthdate: actor.birthdate,
|
||||
age: moment().diff(actor.birthdate, 'years'),
|
||||
avatar: actor.avatar,
|
||||
origin: {
|
||||
country: {
|
||||
name: actor.birth_country_alias,
|
||||
alpha2: actor.birth_country_alpha2,
|
||||
},
|
||||
},
|
||||
origin: actor.birth_country_alpha2
|
||||
? {
|
||||
country: {
|
||||
name: actor.birth_country_alias,
|
||||
alpha2: actor.birth_country_alpha2,
|
||||
},
|
||||
}
|
||||
: null,
|
||||
})),
|
||||
director: release.director,
|
||||
tags,
|
||||
@@ -80,11 +82,6 @@ async function curateRelease(release) {
|
||||
photos: media.filter(item => item.role === 'photo'),
|
||||
poster: media.filter(item => item.role === 'poster')[0],
|
||||
trailer: media.filter(item => item.role === 'trailer')[0],
|
||||
rating: {
|
||||
likes: release.likes,
|
||||
dislikes: release.dislikes,
|
||||
stars: release.stars,
|
||||
},
|
||||
site: {
|
||||
id: release.site_id,
|
||||
name: release.site_name,
|
||||
@@ -143,9 +140,9 @@ async function curateScrapedRelease(release) {
|
||||
description: release.description,
|
||||
// director: release.director,
|
||||
duration: release.duration,
|
||||
likes: release.rating && release.rating.likes,
|
||||
dislikes: release.rating && release.rating.dislikes,
|
||||
rating: release.rating && release.rating.stars && Math.floor(release.rating.stars),
|
||||
// likes: release.rating && release.rating.likes,
|
||||
// dislikes: release.rating && release.rating.dislikes,
|
||||
// rating: release.rating && release.rating.stars && Math.floor(release.rating.stars),
|
||||
deep: typeof release.deep === 'boolean' ? release.deep : false,
|
||||
};
|
||||
|
||||
|
||||
@@ -142,6 +142,8 @@ async function scrapeReleases() {
|
||||
concurrency: 5,
|
||||
});
|
||||
|
||||
console.log(scrapedReleases.flat(2).map(release => release.movie));
|
||||
|
||||
if (argv.save) {
|
||||
await storeReleases(scrapedReleases.flat(2));
|
||||
}
|
||||
|
||||
@@ -4,15 +4,13 @@ const bhttp = require('bhttp');
|
||||
const cheerio = require('cheerio');
|
||||
const moment = require('moment');
|
||||
|
||||
const { matchTags } = require('../tags');
|
||||
|
||||
async function scrape(json, site) {
|
||||
return Promise.all(json.map(async (scene) => {
|
||||
const {
|
||||
title,
|
||||
description,
|
||||
length,
|
||||
master_categories: rawTags,
|
||||
master_categories: tags,
|
||||
ratings_up: likes,
|
||||
ratings_down: dislikes,
|
||||
} = scene;
|
||||
@@ -23,8 +21,8 @@ async function scrape(json, site) {
|
||||
const actors = scene.actors.map(({ name }) => name);
|
||||
const director = scene.directors[0].name;
|
||||
|
||||
const tags = await matchTags(rawTags);
|
||||
const poster = `https://images-evilangel.gammacdn.com/movies${scene.pictures.resized}`;
|
||||
const movie = `https://evilangel.com/en/movie/${scene.url_movie_title}/${scene.movie_id}`;
|
||||
|
||||
return {
|
||||
url,
|
||||
@@ -41,6 +39,7 @@ async function scrape(json, site) {
|
||||
likes,
|
||||
dislikes,
|
||||
},
|
||||
movie,
|
||||
site,
|
||||
};
|
||||
}));
|
||||
@@ -71,11 +70,7 @@ async function scrapeScene(html, url, site) {
|
||||
const duration = moment.duration(data.duration.slice(2).split(':')).asSeconds();
|
||||
|
||||
const rawTags = data.keywords.split(', ');
|
||||
const tags = await matchTags(
|
||||
hasTrans
|
||||
? [...rawTags, 'transsexual']
|
||||
: rawTags,
|
||||
);
|
||||
const tags = hasTrans ? [...rawTags, 'transsexual'] : rawTags;
|
||||
|
||||
const poster = videoData.picPreview;
|
||||
const trailer = `${videoData.playerOptions.host}${videoData.url}`;
|
||||
|
||||
Reference in New Issue
Block a user