Passing context object with site or network instead of scraper slug and 'site or network' to all profile scrapers.
This commit is contained in:
@@ -78,12 +78,10 @@ async function fetchScene(url, site) {
|
||||
return res.ok ? scrapeScene(res.item, url, site) : res.status;
|
||||
}
|
||||
|
||||
async function fetchProfile(actorName, scraperSlug) {
|
||||
async function fetchProfile(actorName, { site }) {
|
||||
const actorSlug = slugify(actorName, '');
|
||||
const url = scraperSlug === 'povperverts'
|
||||
? `https://povperverts.net/models/${actorSlug}.html`
|
||||
: `https://${scraperSlug}.com/models/${actorSlug}.html`;
|
||||
|
||||
const url = `${site.url}/models/${actorSlug}.html`;
|
||||
const res = await get(url);
|
||||
|
||||
return res.ok ? scrapeProfile(res.item, actorName) : res.status;
|
||||
|
||||
Reference in New Issue
Block a user