Changed q get and geta APIs to include status, refactored scrapers. Showing front- and back-cover on movie tiles and release page (fix). Removed icons from main navigation. Returning scenes from Jules Jordan movie scraper.

This commit is contained in:
2020-03-08 04:23:10 +01:00
parent b45bb0cfbc
commit acad99bdfe
15 changed files with 222 additions and 119 deletions

View File

@@ -67,15 +67,15 @@ function scrapeProfile({ el, q, qtx }) {
async function fetchLatest(site, page = 1) {
const url = `${site.url}/categories/movies_${page}_d.html`;
const qLatest = await geta(url, '.latest-updates .update');
const res = await geta(url, '.latest-updates .update');
return qLatest && scrapeAll(qLatest, site);
return res.ok ? scrapeAll(res.items, site) : res.status;
}
async function fetchScene(url, site) {
const qScene = await get(url, '.content-wrapper');
const res = await get(url, '.content-wrapper');
return qScene && scrapeScene(qScene, url, site);
return res.ok ? scrapeScene(res.item, url, site) : res.status;
}
async function fetchProfile(actorName, scraperSlug) {
@@ -84,9 +84,9 @@ async function fetchProfile(actorName, scraperSlug) {
? `https://povperverts.net/models/${actorSlug}.html`
: `https://${scraperSlug}.com/models/${actorSlug}.html`;
const qProfile = await get(url);
const res = await get(url);
return qProfile && scrapeProfile(qProfile, actorName);
return res.ok ? scrapeProfile(res.item, actorName) : res.status;
}
module.exports = {