Added studio support. Added studios for LegalPorno. Improved media fetch error handling. Fixed DDFNetwork scraper, added media support.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
const bhttp = require('bhttp');
|
||||
const cheerio = require('cheerio');
|
||||
const moment = require('moment');
|
||||
const knex = require('../knex');
|
||||
|
||||
const { matchTags } = require('../tags');
|
||||
|
||||
@@ -95,8 +96,17 @@ 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 tags = await matchTags(rawTags);
|
||||
|
||||
const [studio, tags] = await Promise.all([
|
||||
knex('studios')
|
||||
.where({ name: studioName })
|
||||
.orWhere({ slug: studioSlug })
|
||||
.first(),
|
||||
matchTags(rawTags),
|
||||
]);
|
||||
|
||||
return {
|
||||
url,
|
||||
@@ -115,6 +125,7 @@ async function scrapeScene(html, url, site, useGallery) {
|
||||
},
|
||||
tags,
|
||||
site,
|
||||
studio,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user