From f7f5e8a30699989546173f912ea3c3fd91c1758c Mon Sep 17 00:00:00 2001 From: Niels Simenon Date: Mon, 28 Oct 2019 02:12:11 +0100 Subject: [PATCH] Deriving transsexual tag from actors in Evil Angel scraper. --- seeds/02_tags.js | 18 ++++++++++++++++++ src/scrapers/evilangel.js | 7 ++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/seeds/02_tags.js b/seeds/02_tags.js index b1ba5cd5..e4375731 100644 --- a/seeds/02_tags.js +++ b/seeds/02_tags.js @@ -31,6 +31,10 @@ exports.seed = knex => Promise.resolve() slug: 'location', group: 'Location', }, + { + slug: 'orientation', + group: 'Orientation', + }, { slug: 'penetration', group: 'Penetration', @@ -171,6 +175,11 @@ exports.seed = knex => Promise.resolve() alias_for: null, group_id: groupsMap['body'], }, + { + name: 'bisexual', + slug: 'bisexual', + alias_for: null, + }, { name: 'black hair', slug: 'black-hair', @@ -388,6 +397,11 @@ exports.seed = knex => Promise.resolve() slug: 'gaping', alias_for: null, }, + { + name: 'gay', + slug: 'gay', + alias_for: null, + }, { name: 'gonzo', slug: 'gonzo', @@ -854,6 +868,10 @@ exports.seed = knex => Promise.resolve() name: 'big tits', alias_for: tagsMap['big-boobs'], }, + { + name: 'bi', + alias_for: tagsMap['bisexual'], + }, { name: 'black', alias_for: tagsMap['ebony'], diff --git a/src/scrapers/evilangel.js b/src/scrapers/evilangel.js index d420297d..cd1172db 100644 --- a/src/scrapers/evilangel.js +++ b/src/scrapers/evilangel.js @@ -63,6 +63,7 @@ async function scrapeScene(html, url, site) { const date = moment.utc($('.updatedDate').first().text(), 'MM-DD-YYYY').toDate(); const actors = data.actor.map(actor => actor.name); + const hasTrans = data.actor.some(actor => actor.gender === 'shemale'); const director = (data.director && data.director[0].name) || (data2.director && data2.director[0].name) || null; const stars = (data.aggregateRating.ratingValue / data.aggregateRating.bestRating) * 5; @@ -70,7 +71,11 @@ 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(rawTags); + const tags = await matchTags( + hasTrans + ? [...rawTags, 'transsexual'] + : rawTags, + ); const poster = videoData.picPreview; const trailer = `${videoData.playerOptions.host}${videoData.url}`;