forked from DebaucheryLibrarian/traxxx
Enabled pagination on network page.
This commit is contained in:
@@ -16,7 +16,7 @@ function scrape(html, site) {
|
||||
return sceneElements.map((element) => {
|
||||
const sceneLinkElement = $(element).find('.thmb_lnk');
|
||||
const title = sceneLinkElement.attr('title');
|
||||
const url = site.legacy
|
||||
const url = site.parameters?.legacy
|
||||
? `https://${site.url}{sceneLinkElement.attr('href')}`
|
||||
: `https://bangbros.com${sceneLinkElement.attr('href')}`;
|
||||
const shootId = sceneLinkElement.attr('id') && sceneLinkElement.attr('id').split('-')[1];
|
||||
@@ -150,14 +150,14 @@ function scrapeSceneLegacy({ qu }, url) {
|
||||
return release;
|
||||
}
|
||||
|
||||
function scrapeProfile(html) {
|
||||
function scrapeProfile(html, scope) {
|
||||
const { q } = ex(html);
|
||||
const profile = {};
|
||||
|
||||
const avatar = q('.profilePic img', 'src');
|
||||
if (avatar) profile.avatar = `https:${avatar}`;
|
||||
|
||||
profile.releases = scrape(html);
|
||||
profile.releases = scrape(html, scope.network);
|
||||
|
||||
return profile;
|
||||
}
|
||||
@@ -221,7 +221,7 @@ async function fetchScene(url, site, release) {
|
||||
return scrapeScene(res.item.html, url, site);
|
||||
}
|
||||
|
||||
async function fetchProfile(actorName) {
|
||||
async function fetchProfile(actorName, scope) {
|
||||
const actorSlug = slugify(actorName);
|
||||
const url = `https://bangbros.com/search/${actorSlug}`;
|
||||
const res = await bhttp.get(url);
|
||||
@@ -233,7 +233,7 @@ async function fetchProfile(actorName) {
|
||||
const actorRes = await bhttp.get(actorUrl);
|
||||
|
||||
if (actorRes.statusCode === 200) {
|
||||
return scrapeProfile(actorRes.body.toString());
|
||||
return scrapeProfile(actorRes.body.toString(), scope);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user