Improved Vixen and XEmpire scrapers. Added media to Blowpass scraper. Improved release fetch code.

This commit is contained in:
2019-09-26 03:27:01 +02:00
parent 96d8cfbcb6
commit 298eabe56e
11 changed files with 123 additions and 79 deletions

View File

@@ -54,7 +54,9 @@ async function scrapeScene(html, url, site) {
const entryId = new URL(url).pathname.split('/').slice(-1)[0];
const title = $('meta[name="twitter:title"]').attr('content');
const date = moment.utc(data.dateCreated, 'YYYY-MM-DD').toDate();
const description = data.description || $('meta[name="twitter:description"]').attr('content');
// date in data object is not the release date of the scene, but the date the entry was added
const date = moment.utc($('.updatedDate').first().text(), 'MM-DD-YYYY').toDate();
const actors = data.actor
.sort(({ gender: genderA }, { gender: genderB }) => {
@@ -65,7 +67,6 @@ async function scrapeScene(html, url, site) {
})
.map(actor => actor.name);
const description = data.description || undefined;
const stars = (data.aggregateRating.ratingValue / data.aggregateRating.bestRating) * 5;
const duration = moment.duration(data.duration.slice(2).split(':')).asSeconds();