Added Kink scraper with elaborate site specification.

This commit is contained in:
2019-03-24 05:28:18 +01:00
parent e85a0f45f9
commit 845f46e9ad
16 changed files with 590 additions and 143 deletions

View File

@@ -119,8 +119,7 @@ function scrapeScene(html, url, site) {
const description = data.description || undefined;
const stars = (data.aggregateRating.ratingValue / data.aggregateRating.bestRating) * 5;
const runtime = data.duration.slice(2).split(':');
const duration = Number(runtime[0]) * 3600 + Number(runtime[1]) * 60 + Number(runtime[2]);
const duration = moment.duration(data.duration.slice(2).split(':')).asSeconds();
const rawTags = data.keywords.split(', ');
const tags = rawTags.reduce((accTags, tag) => (tagMap[tag] ? [...accTags, tagMap[tag]] : accTags), []);