From 0b86def3150ea79a606b7933527b7d73352e9c40 Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Thu, 26 Nov 2020 03:27:21 +0100 Subject: [PATCH] Ignoring non-scene page (possible CF or similar protection) in Vixen scraper. --- src/scrapers/vixen.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/scrapers/vixen.js b/src/scrapers/vixen.js index c6a25c17..3040dec8 100644 --- a/src/scrapers/vixen.js +++ b/src/scrapers/vixen.js @@ -240,7 +240,11 @@ async function fetchScene(url, site, baseRelease) { const res = await http.get(apiUrl); if (res.ok) { - return scrapeScene(res.body.data, url, site, baseRelease); + if (res.body.data) { + return scrapeScene(res.body.data, url, site, baseRelease); + } + + return null; } return res.status; @@ -253,10 +257,14 @@ async function fetchProfile({ name: actorName }, { site }, include) { const res = await http.get(url); if (res.ok) { - return scrapeProfile(res.body.data, origin, include.scenes); + if (res.body.data) { + return scrapeProfile(res.body.data, origin, include.scenes); + } + + return null; } - return null; + return res.status; } module.exports = {