Bugfixes
parent
f86a73ed18
commit
bf7e409e0c
|
@ -3,7 +3,6 @@
|
||||||
// Public modules from npm
|
// Public modules from npm
|
||||||
const HTMLParser = require("node-html-parser");
|
const HTMLParser = require("node-html-parser");
|
||||||
const puppeteer = require("puppeteer");
|
const puppeteer = require("puppeteer");
|
||||||
const urlExist = require("url-exist");
|
|
||||||
|
|
||||||
// Modules from file
|
// Modules from file
|
||||||
const shared = require("./shared.js");
|
const shared = require("./shared.js");
|
||||||
|
@ -11,7 +10,7 @@ const selectors = require("./constants/css-selectors.js");
|
||||||
const { preparePage } = require("./puppeteer-helper.js");
|
const { preparePage } = require("./puppeteer-helper.js");
|
||||||
const GameDownload = require("./classes/game-download.js");
|
const GameDownload = require("./classes/game-download.js");
|
||||||
const GameInfo = require("./classes/game-info.js");
|
const GameInfo = require("./classes/game-info.js");
|
||||||
const { isStringAValidURL, isF95URL } = require("./urls-helper.js");
|
const { isStringAValidURL, isF95URL, urlExists } = require("./urls-helper.js");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @protected
|
* @protected
|
||||||
|
@ -25,7 +24,7 @@ module.exports.getGameInfo = async function (browser, url) {
|
||||||
|
|
||||||
// Verify the correctness of the URL
|
// Verify the correctness of the URL
|
||||||
if (!isF95URL(url)) throw url + " is not a valid F95Zone 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();
|
if (!exists) return new GameInfo();
|
||||||
|
|
||||||
let page = await preparePage(browser); // Set new isolated page
|
let page = await preparePage(browser); // Set new isolated page
|
||||||
|
|
|
@ -42,7 +42,7 @@ module.exports.isStringAValidURL = function (url) {
|
||||||
* @returns {Promise<Boolean>} true if the URL exists, false otherwise
|
* @returns {Promise<Boolean>} true if the URL exists, false otherwise
|
||||||
*/
|
*/
|
||||||
module.exports.urlExists = async function (url, checkRedirect) {
|
module.exports.urlExists = async function (url, checkRedirect) {
|
||||||
if (!this.isStringAValidURL(url)) {
|
if (!exports.isStringAValidURL(url)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
1016
coverage.lcov
1016
coverage.lcov
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue