Fixed Vivid requesting unavailable HTTPS resource, and breaking on non-existing parameters object.

This commit is contained in:
2020-03-07 00:32:04 +01:00
parent 2791821239
commit ea0e37aa49
2 changed files with 11 additions and 11 deletions

View File

@@ -104,7 +104,7 @@ async function fetchSceneNative(url, site, release) {
async function fetchSceneWrapper(url, site, release) {
const scene = await fetchScene(url, site, release);
if (scene.date - new Date(site.parameters.lastNative) <= 0) {
if (scene.date - new Date(site.parameters?.lastNative) <= 0) {
// scene is probably still available on Vivid site, use search API to get URL and original date
const searchUrl = `${site.url}/videos/api/?limit=10&sort=datedesc&search=${encodeURI(scene.title)}`;
const searchRes = await bhttp.get(searchUrl, {