Added site aliases. Migrated various scrapers to qu. Added BAM Visions base.

This commit is contained in:
2020-03-12 00:15:25 +01:00
parent c020d5659e
commit 37e188a0df
11 changed files with 400 additions and 69 deletions

View File

@@ -41,22 +41,22 @@ function scrapeLatest(scenes, site, models) {
});
}
function scrapeScene({ html, q, qa, qd, qis }, url, site, models) {
function scrapeScene({ html, qu }, url, site, models) {
const release = { url };
[release.entryId] = url.split('/').slice(-1);
release.title = q('.mas_title', true);
release.description = q('.mas_longdescription', true);
release.date = qd('.mas_description', 'MMMM DD, YYYY', /\w+ \d{1,2}, \d{4}/);
release.title = qu.q('.mas_title', true);
release.description = qu.q('.mas_longdescription', true);
release.date = qu.date('.mas_description', 'MMMM DD, YYYY', /\w+ \d{1,2}, \d{4}/);
const actorString = q('.mas_description', true).replace(/\w+ \d{1,2}, \d{4}/, '');
const actorString = qu.q('.mas_description', true).replace(/\w+ \d{1,2}, \d{4}/, '');
const actors = matchActors(actorString, models);
if (actors.length > 0) release.actors = actors;
else release.actors = extractActors(actorString);
release.tags = qa('.tags a', true);
release.tags = qu.all('.tags a', true);
release.photos = qis('.stills img').map(photoPath => `${site.url}/${photoPath}`);
release.photos = qu.imgs('.stills img').map(photoPath => `${site.url}/${photoPath}`);
const posterIndex = 'splash:';
const poster = html.slice(html.indexOf('faceimages/', posterIndex), html.indexOf('.jpg', posterIndex) + 4);