Major API change for 'q', renamed to 'qu', refactored modules. Fixed Gamma URL entry ID regex.

This commit is contained in:
2020-03-09 02:02:29 +01:00
parent 7d71cf3a8c
commit 6cbb7f9c1e
21 changed files with 611 additions and 561 deletions

View File

@@ -178,16 +178,16 @@ async function fetchScene(url, site) {
async function fetchProfile(actorName) {
const actorSearchSlug = slugify(actorName, { delimiter: '+' });
const url = `https://www.private.com/search.php?query=${actorSearchSlug}`;
const modelLinks = await geta(url, '.model h3 a');
const modelRes = await geta(url, '.model h3 a');
if (modelLinks) {
if (modelRes.ok) {
const actorSlug = slugify(actorName);
const model = modelLinks.find(({ text }) => slugify(text) === actorSlug);
const model = modelRes.items.find(({ text }) => slugify(text) === actorSlug);
if (model) {
const qProfile = await get(model.el.href);
const res = await get(model.el.href);
return qProfile && scrapeProfile(qProfile);
return res.ok ? scrapeProfile(res.item) : res.status;
}
}