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

@@ -65,8 +65,7 @@ function scrapeScene(html, url, site) {
.find('a[href*="com/model"]')
.map((actorIndex, actorElement) => $(actorElement).text()).toArray();
const runtime = $('span[title="Runtime"]').text().trim().split(':');
const duration = Number(runtime[0]) * 3600 + Number(runtime[1]) * 60 + Number(runtime[2]);
const duration = moment.duration($('span[title="Runtime"]').text().trim()).asSeconds();
const rawTags = $(tagsElement).find('a').map((tagIndex, tagElement) => $(tagElement).text()).toArray();
const tags = rawTags.reduce((accTags, tag) => (tagMap[tag] ? [...accTags, tagMap[tag]] : accTags), []);