From 85d24eda78cca67070ca7f083fb13af93624658b Mon Sep 17 00:00:00 2001 From: Kiko Beats Date: Wed, 20 Jul 2022 10:27:48 +0200 Subject: [PATCH] fix(audio): only consider http urls --- packages/metascraper-audio/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/metascraper-audio/index.js b/packages/metascraper-audio/index.js index 039592127..fc57893de 100644 --- a/packages/metascraper-audio/index.js +++ b/packages/metascraper-audio/index.js @@ -72,7 +72,11 @@ module.exports = ({ getIframe = _getIframe, gotOpts, keyvOpts } = {}) => { iframe.each(function () { const src = $(this).attr('src') const normalizedUrl = normalizeUrl(url, src) - if (normalizedUrl && srcs.indexOf(normalizedUrl) === -1) { + if ( + typeof normalizedUrl === 'string' && + normalizedUrl.startsWith('http') && + srcs.indexOf(normalizedUrl) === -1 + ) { srcs.push(normalizedUrl) } })