forked from DebaucheryLibrarian/traxxx
Improved module structure. Added individual scene scrapers for Jules Jordan and XEmpire.
This commit is contained in:
@@ -17,7 +17,7 @@ function scrape(html, site) {
|
||||
const stars = $('img[src*="/star.png"]')
|
||||
.toArray()
|
||||
.map(element => $(element).attr('src'))
|
||||
.length || null;
|
||||
.length || 0;
|
||||
|
||||
return {
|
||||
url,
|
||||
@@ -25,15 +25,13 @@ function scrape(html, site) {
|
||||
actors,
|
||||
date,
|
||||
rating: {
|
||||
likes: null,
|
||||
dislikes: null,
|
||||
stars,
|
||||
},
|
||||
site,
|
||||
};
|
||||
}
|
||||
|
||||
async function fetchReleases(site) {
|
||||
async function fetchLatest(site) {
|
||||
const res = await bhttp.get(`${site.url}/final_latestupdateview.php?limitstart=0&limitend=9&websiteid=0&deviceview=browser&tourId=${site.parameters.tourId}`);
|
||||
const elements = JSON.parse(res.body.toString());
|
||||
|
||||
@@ -42,4 +40,6 @@ async function fetchReleases(site) {
|
||||
return latest;
|
||||
}
|
||||
|
||||
module.exports = fetchReleases;
|
||||
module.exports = {
|
||||
fetchLatest,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user