Fixed qu issues. Fixed media issues. Simplified and expanded date component in search query.

This commit is contained in:
2020-03-10 00:17:57 +01:00
parent 61a795d634
commit 5c55750c0c
9 changed files with 113 additions and 116 deletions

View File

@@ -101,22 +101,24 @@ function scrapeScene(html, url, site) {
}
async function fetchActorReleases(url) {
const { qus } = await get(url);
const res = await get(url);
return qus('.contain-block:not(.live-scenes) .scene-item > a:first-child'); // live scenes repeat on all pages
return res.ok
? res.item.qu.urls('.contain-block:not(.live-scenes) .scene-item > a:first-child') // live scenes repeat on all pages
: [];
}
async function scrapeProfile(html) {
const { q, qus } = ex(html);
const { qu } = ex(html);
const profile = {};
profile.description = q('.bio_about_text', true);
profile.description = qu.q('.bio_about_text', true);
const avatar = q('img.performer-pic', 'src');
const avatar = qu.q('img.performer-pic', 'src');
if (avatar) profile.avatar = `https:${avatar}`;
const releases = qus('.scene-item > a:first-child');
const otherPages = qus('.pagination a:not([rel=next]):not([rel=prev])');
const releases = qu.urls('.scene-item > a:first-child');
const otherPages = qu.urls('.pagination a:not([rel=next]):not([rel=prev])');
const olderReleases = await Promise.all(otherPages.map(async page => fetchActorReleases(page)));
profile.releases = releases.concat(olderReleases.flat());