forked from DebaucheryLibrarian/traxxx
Added Bang! scraper. Showing studio on tile. Added favicons to tiles.
This commit is contained in:
@@ -4,9 +4,6 @@ const bhttp = require('bhttp');
|
||||
const { JSDOM } = require('jsdom');
|
||||
const cheerio = require('cheerio');
|
||||
const moment = require('moment');
|
||||
const knex = require('../knex');
|
||||
|
||||
const { matchTags } = require('../tags');
|
||||
|
||||
function extractTitle(originalTitle) {
|
||||
const titleComponents = originalTitle.split(' ');
|
||||
@@ -102,16 +99,8 @@ async function scrapeScene(html, url, site, useGallery) {
|
||||
const trailer = data.clip.qualities.find(clip => clip.quality === 'vga' || clip.quality === 'hd');
|
||||
|
||||
const studioName = $('.watchpage-studioname').first().text().trim();
|
||||
const studioSlug = studioName.replace(/\s+/g, '').toLowerCase();
|
||||
const rawTags = $(tagsElement).find('a').map((tagIndex, tagElement) => $(tagElement).text()).toArray();
|
||||
|
||||
const [studio, tags] = await Promise.all([
|
||||
knex('studios')
|
||||
.where({ name: studioName })
|
||||
.orWhere({ slug: studioSlug })
|
||||
.first(),
|
||||
matchTags(rawTags),
|
||||
]);
|
||||
const studio = studioName.replace(/[\s.']+/g, '').toLowerCase();
|
||||
const tags = $(tagsElement).find('a').map((tagIndex, tagElement) => $(tagElement).text()).toArray();
|
||||
|
||||
return {
|
||||
url,
|
||||
|
||||
Reference in New Issue
Block a user