forked from DebaucheryLibrarian/traxxx
Added Fuck'n'Drive and Jizz On Teens latest layouts to First Anal Quest scraper.
This commit is contained in:
parent
2e0fba3de9
commit
f0bec85ef8
|
@ -2795,6 +2795,7 @@ const sites = [
|
|||
parent: 'firstanalquest',
|
||||
parameters: {
|
||||
layout: 'b',
|
||||
paginated: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
@ -34,6 +34,33 @@ function scrapeAllA(scenes, channel) {
|
|||
});
|
||||
}
|
||||
|
||||
function scrapeAllB(scenes, channel) {
|
||||
return scenes.map(({ query }) => {
|
||||
const release = {};
|
||||
|
||||
release.title = query.cnt('.title, h2');
|
||||
release.description = query.cnt('.description, p textarea');
|
||||
release.duration = query.dur('.time');
|
||||
|
||||
const previewHtml = query.html('script')?.match(/document.write\("(.*)"\);/)?.[1];
|
||||
const previewEl = qu.extract(previewHtml);
|
||||
const previewQuery = previewEl?.query.q('param[name="flashvars"]', 'value') || query.q('param[name="flashvars"]', 'value');
|
||||
const previewParams = previewQuery && new URLSearchParams(previewQuery);
|
||||
|
||||
if (previewParams) {
|
||||
release.poster = qu.prefixUrl(previewParams.get('image') || previewParams.get('poster'), channel.url);
|
||||
release.trailer = previewParams.get('file');
|
||||
}
|
||||
|
||||
release.photos = query.imgs('img[src*="sets/"], img[src*="thumbnails/"]', 'src', { origin: channel.url });
|
||||
|
||||
release.entryId = release.poster?.match(/\/sets\/(.*)\//)?.[1] || slugify(release.title);
|
||||
|
||||
console.log(release);
|
||||
return release;
|
||||
});
|
||||
}
|
||||
|
||||
function scrapeSceneA({ query }, url, channel) {
|
||||
const release = {};
|
||||
|
||||
|
@ -127,6 +154,20 @@ async function fetchLatestA(channel, page) {
|
|||
return res.status;
|
||||
}
|
||||
|
||||
async function fetchLatestB(channel, page) {
|
||||
const url = channel.parameters?.paginated
|
||||
? `${channel.url}/page/${page}`
|
||||
: channel.url;
|
||||
|
||||
const res = await qu.getAll(url, '#container, article:not(.sortby)');
|
||||
|
||||
if (res.ok) {
|
||||
return scrapeAllB(res.items, channel);
|
||||
}
|
||||
|
||||
return res.status;
|
||||
}
|
||||
|
||||
async function fetchSceneA(url, channel) {
|
||||
const res = await qu.get(url, '.main, .main-content');
|
||||
|
||||
|
@ -166,4 +207,7 @@ module.exports = {
|
|||
fetchScene: fetchSceneA,
|
||||
fetchProfile: fetchProfileA,
|
||||
},
|
||||
b: {
|
||||
fetchLatest: fetchLatestB,
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue