Major refactor, cleand up site scrape module, fixed and cleaned up release scrape module. Removed old CLI code
This commit is contained in:
@@ -23,7 +23,7 @@ function scrapeLatest(html, site) {
|
||||
const { videos: scenes } = JSON.parse(stateScript.slice(stateScript.indexOf('{'), stateScript.indexOf('};') + 1));
|
||||
|
||||
return scenes.map((scene) => {
|
||||
const shootId = String(scene.newId);
|
||||
const entryId = String(scene.newId);
|
||||
|
||||
const {
|
||||
title,
|
||||
@@ -40,7 +40,7 @@ function scrapeLatest(html, site) {
|
||||
|
||||
return {
|
||||
url,
|
||||
shootId,
|
||||
entryId,
|
||||
title,
|
||||
actors,
|
||||
date,
|
||||
@@ -65,8 +65,8 @@ async function scrapeScene(html, url, site) {
|
||||
const stateObject = $('script:contains("INITIAL_STATE")');
|
||||
const data = JSON.parse(stateObject.html().trim().slice(27, -1));
|
||||
|
||||
const shootId = data.page.data[`${pathname}${search}`].data.video;
|
||||
const scene = data.videos.find(video => video.newId === shootId);
|
||||
const entryId = data.page.data[`${pathname}${search}`].data.video;
|
||||
const scene = data.videos.find(video => video.newId === entryId);
|
||||
|
||||
const [poster, ...photos] = scene.rotatingThumbsUrlSizes.map(photo => photo['1040w']);
|
||||
const trailer = scene.previews.listing.find(preview => preview.height === 353) || null;
|
||||
@@ -86,7 +86,7 @@ async function scrapeScene(html, url, site) {
|
||||
|
||||
return {
|
||||
url,
|
||||
shootId,
|
||||
entryId,
|
||||
title,
|
||||
description,
|
||||
actors,
|
||||
|
||||
Reference in New Issue
Block a user