pull/11/head
MillenniumEarl 2020-10-09 16:58:32 +02:00
parent f86a73ed18
commit bf7e409e0c
3 changed files with 521 additions and 502 deletions

View File

@ -3,7 +3,6 @@
// Public modules from npm
const HTMLParser = require("node-html-parser");
const puppeteer = require("puppeteer");
const urlExist = require("url-exist");
// Modules from file
const shared = require("./shared.js");
@ -11,7 +10,7 @@ const selectors = require("./constants/css-selectors.js");
const { preparePage } = require("./puppeteer-helper.js");
const GameDownload = require("./classes/game-download.js");
const GameInfo = require("./classes/game-info.js");
const { isStringAValidURL, isF95URL } = require("./urls-helper.js");
const { isStringAValidURL, isF95URL, urlExists } = require("./urls-helper.js");
/**
* @protected
@ -25,7 +24,7 @@ module.exports.getGameInfo = async function (browser, url) {
// Verify the correctness of the URL
if (!isF95URL(url)) throw url + " is not a valid F95Zone URL";
let exists = await urlExist(url);
let exists = await urlExists(url);
if (!exists) return new GameInfo();
let page = await preparePage(browser); // Set new isolated page

View File

@ -42,7 +42,7 @@ module.exports.isStringAValidURL = function (url) {
* @returns {Promise<Boolean>} true if the URL exists, false otherwise
*/
module.exports.urlExists = async function (url, checkRedirect) {
if (!this.isStringAValidURL(url)) {
if (!exports.isStringAValidURL(url)) {
return false;
}

File diff suppressed because it is too large Load Diff