Removed release_date selection, not working as desired. Removed site and tag fetching from Kink scraper.

This commit is contained in:
2019-12-05 01:33:57 +01:00
parent 71cb85c3e1
commit 2697aaa0af
2 changed files with 4 additions and 16 deletions

View File

@@ -4,9 +4,6 @@ const bhttp = require('bhttp');
const cheerio = require('cheerio');
const moment = require('moment');
const { fetchSites } = require('../sites');
const { matchTags } = require('../tags');
function scrapeLatest(html, site) {
const $ = cheerio.load(html, { normalizeWhitespace: true });
const sceneElements = $('.shoot-list .shoot').toArray();
@@ -73,17 +70,9 @@ async function scrapeScene(html, url, shootId, ratingRes, site) {
const siteName = $('.shoot-logo a').attr('href').split('/')[2];
const siteSlug = siteName.replace(/\s+/g, '').toLowerCase();
const rawTags = $('.tag-list > a[href*="/tag"]').map((tagIndex, tagElement) => $(tagElement).text()).toArray();
const [[channelSite], tags] = await Promise.all([
site.isFallback
? fetchSites({
slug: siteSlug,
name: siteName,
})
: [site],
matchTags(rawTags),
]);
const tags = $('.tag-list > a[href*="/tag"]').map((tagIndex, tagElement) => $(tagElement).text()).toArray();
const channel = siteSlug;
return {
url,
@@ -103,7 +92,8 @@ async function scrapeScene(html, url, shootId, ratingRes, site) {
stars,
},
tags,
site: channelSite || site,
site,
channel,
};
}