From aaaa240863600c729633e1c913d0f061746b9163 Mon Sep 17 00:00:00 2001 From: Seyden Date: Sun, 4 Aug 2024 04:26:44 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20TheNetsk?= =?UTF-8?q?y/community-extensions@30bd775783c4aae0ad72e7128eccc473d1358ab2?= =?UTF-8?q?=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 0.8/AsuraScans/index.js | 16 +++++++++++++--- 0.8/AsuraScans/source.js | 16 +++++++++++++--- 0.8/versioning.json | 2 +- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/0.8/AsuraScans/index.js b/0.8/AsuraScans/index.js index a297973..a77fb81 100644 --- a/0.8/AsuraScans/index.js +++ b/0.8/AsuraScans/index.js @@ -2784,6 +2784,7 @@ var defaults = { parameterLimit: 1000, parseArrays: true, plainObjects: false, + strictDepth: false, strictNullHandling: false }; @@ -2961,9 +2962,12 @@ var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesPars keys.push(segment[1]); } - // If there's a remainder, just add whatever is left + // If there's a remainder, check strictDepth option for throw, else just add whatever is left if (segment) { + if (options.strictDepth === true) { + throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true'); + } keys.push('[' + key.slice(segment.index) + ']'); } @@ -3020,6 +3024,7 @@ var normalizeParseOptions = function normalizeParseOptions(opts) { parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit, parseArrays: opts.parseArrays !== false, plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects, + strictDepth: typeof opts.strictDepth === 'boolean' ? !!opts.strictDepth : defaults.strictDepth, strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling }; }; @@ -3918,7 +3923,7 @@ const simpleUrl = require('simple-url'); const ASURASCANS_DOMAIN = 'https://asuracomic.net'; const ASURASCANS_API_DOMAIN = 'https://gg.asuracomic.net'; exports.AsuraScansInfo = { - version: '4.1.5', + version: '4.1.6', name: 'AsuraScans', description: 'Extension that pulls manga from AsuraScans', author: 'Seyden', @@ -3975,6 +3980,11 @@ class AsuraScans { path.protocol = 'https'; request.url = simpleUrl.create(path); } + if (path.host.includes(`localhost`)) { + const url = await this.getBaseUrl(); + path.host = simpleUrl.parse(url, true).host; + request.url = simpleUrl.create(path); + } if ((0, AsuraScansHelper_1.isImgLink)(request.url)) { let overrideUrl = await this.stateManager.retrieve('Domain'); if (overrideUrl && overrideUrl != this.baseUrl) { @@ -4669,7 +4679,7 @@ class AsuraScansParser { image = 'https://i.imgur.com/GYUxEX8.png'; } image = image?.split('?resize')[0] ?? ''; - return encodeURI(decodeURI(this.decodeHTMLEntity(image?.trim() ?? ''))); + return decodeURI(this.decodeHTMLEntity(image?.trim() ?? '')); } decodeHTMLEntity(str) { if (!str) { diff --git a/0.8/AsuraScans/source.js b/0.8/AsuraScans/source.js index a297973..a77fb81 100644 --- a/0.8/AsuraScans/source.js +++ b/0.8/AsuraScans/source.js @@ -2784,6 +2784,7 @@ var defaults = { parameterLimit: 1000, parseArrays: true, plainObjects: false, + strictDepth: false, strictNullHandling: false }; @@ -2961,9 +2962,12 @@ var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesPars keys.push(segment[1]); } - // If there's a remainder, just add whatever is left + // If there's a remainder, check strictDepth option for throw, else just add whatever is left if (segment) { + if (options.strictDepth === true) { + throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true'); + } keys.push('[' + key.slice(segment.index) + ']'); } @@ -3020,6 +3024,7 @@ var normalizeParseOptions = function normalizeParseOptions(opts) { parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit, parseArrays: opts.parseArrays !== false, plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects, + strictDepth: typeof opts.strictDepth === 'boolean' ? !!opts.strictDepth : defaults.strictDepth, strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling }; }; @@ -3918,7 +3923,7 @@ const simpleUrl = require('simple-url'); const ASURASCANS_DOMAIN = 'https://asuracomic.net'; const ASURASCANS_API_DOMAIN = 'https://gg.asuracomic.net'; exports.AsuraScansInfo = { - version: '4.1.5', + version: '4.1.6', name: 'AsuraScans', description: 'Extension that pulls manga from AsuraScans', author: 'Seyden', @@ -3975,6 +3980,11 @@ class AsuraScans { path.protocol = 'https'; request.url = simpleUrl.create(path); } + if (path.host.includes(`localhost`)) { + const url = await this.getBaseUrl(); + path.host = simpleUrl.parse(url, true).host; + request.url = simpleUrl.create(path); + } if ((0, AsuraScansHelper_1.isImgLink)(request.url)) { let overrideUrl = await this.stateManager.retrieve('Domain'); if (overrideUrl && overrideUrl != this.baseUrl) { @@ -4669,7 +4679,7 @@ class AsuraScansParser { image = 'https://i.imgur.com/GYUxEX8.png'; } image = image?.split('?resize')[0] ?? ''; - return encodeURI(decodeURI(this.decodeHTMLEntity(image?.trim() ?? ''))); + return decodeURI(this.decodeHTMLEntity(image?.trim() ?? '')); } decodeHTMLEntity(str) { if (!str) { diff --git a/0.8/versioning.json b/0.8/versioning.json index a87d9cb..48b88ca 100644 --- a/0.8/versioning.json +++ b/0.8/versioning.json @@ -1 +1 @@ -{"buildTime":"2024-07-28T18:27:17.915Z","sources":[{"id":"AsuraScans","name":"AsuraScans","author":"Seyden","desc":"Extension that pulls manga from AsuraScans","website":"https://github.com/Seyden","contentRating":"MATURE","version":"4.1.5","icon":"icon.png","tags":[],"websiteBaseURL":"https://asuracomic.net","intents":53},{"id":"BatoTo","name":"BatoTo","author":"niclimcy","desc":"Extension that pulls manga from bato.to","website":"https://github.com/niclimcy","contentRating":"MATURE","version":"3.1.2","icon":"icon.png","tags":[{"text":"Multi Language","type":"default"}],"websiteBaseURL":"https://bato.to","intents":53},{"id":"Hentai2Read","name":"Hentai2Read","author":"EmZedH","desc":"Extension that pulls manga from hentai2read.com","website":"https://github.com/EmZedH","contentRating":"ADULT","version":"1.0.1","icon":"icon.png","tags":[{"text":"18+","type":"warning"}],"websiteBaseURL":"https://hentai2read.com","intents":5},{"id":"MangaDex","name":"MangaDex","author":"Nar1n & Netsky","desc":"Extension that pulls manga from MangaDex","website":"https://github.com/nar1n","contentRating":"EVERYONE","version":"3.0.5","icon":"icon.png","tags":[],"websiteBaseURL":"https://mangadex.org","intents":37},{"id":"MangaPlus","name":"MangaPlus","author":"Rinto-kun","desc":"Extension that pulls manga from Manga+ by Shueisha","website":"https://github.com/Rinto-kun","contentRating":"EVERYONE","version":"2.0.3","icon":"icon.png","tags":[],"websiteBaseURL":"https://mangaplus.shueisha.co.jp","intents":53},{"id":"NHentai","name":"nhentai","author":"NotMarek & Netsky","desc":"Extension which pulls content from nHentai.","website":"https://github.com/TheNetsky","contentRating":"ADULT","version":"4.0.7","icon":"icon.png","tags":[{"text":"18+","type":"warning"}],"websiteBaseURL":"https://nhentai.net","intents":53}],"builtWith":{"toolchain":"0.8.0-alpha.47","types":"0.8.0-alpha.47"}} \ No newline at end of file +{"buildTime":"2024-08-04T04:26:43.365Z","sources":[{"id":"AsuraScans","name":"AsuraScans","author":"Seyden","desc":"Extension that pulls manga from AsuraScans","website":"https://github.com/Seyden","contentRating":"MATURE","version":"4.1.6","icon":"icon.png","tags":[],"websiteBaseURL":"https://asuracomic.net","intents":53},{"id":"BatoTo","name":"BatoTo","author":"niclimcy","desc":"Extension that pulls manga from bato.to","website":"https://github.com/niclimcy","contentRating":"MATURE","version":"3.1.2","icon":"icon.png","tags":[{"text":"Multi Language","type":"default"}],"websiteBaseURL":"https://bato.to","intents":53},{"id":"Hentai2Read","name":"Hentai2Read","author":"EmZedH","desc":"Extension that pulls manga from hentai2read.com","website":"https://github.com/EmZedH","contentRating":"ADULT","version":"1.0.1","icon":"icon.png","tags":[{"text":"18+","type":"warning"}],"websiteBaseURL":"https://hentai2read.com","intents":5},{"id":"MangaDex","name":"MangaDex","author":"Nar1n & Netsky","desc":"Extension that pulls manga from MangaDex","website":"https://github.com/nar1n","contentRating":"EVERYONE","version":"3.0.5","icon":"icon.png","tags":[],"websiteBaseURL":"https://mangadex.org","intents":37},{"id":"MangaPlus","name":"MangaPlus","author":"Rinto-kun","desc":"Extension that pulls manga from Manga+ by Shueisha","website":"https://github.com/Rinto-kun","contentRating":"EVERYONE","version":"2.0.3","icon":"icon.png","tags":[],"websiteBaseURL":"https://mangaplus.shueisha.co.jp","intents":53},{"id":"NHentai","name":"nhentai","author":"NotMarek & Netsky","desc":"Extension which pulls content from nHentai.","website":"https://github.com/TheNetsky","contentRating":"ADULT","version":"4.0.7","icon":"icon.png","tags":[{"text":"18+","type":"warning"}],"websiteBaseURL":"https://nhentai.net","intents":53}],"builtWith":{"toolchain":"0.8.0-alpha.47","types":"0.8.0-alpha.47"}} \ No newline at end of file