From 40b00a9676a7c20cb8a77aa66c1bc9e70e217aef Mon Sep 17 00:00:00 2001 From: wukko Date: Thu, 16 May 2024 21:34:48 +0600 Subject: [PATCH] soundcloud: use startsWith instead of substring --- src/modules/processing/services/soundcloud.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/processing/services/soundcloud.js b/src/modules/processing/services/soundcloud.js index 04cdcc2b..389eaf6c 100644 --- a/src/modules/processing/services/soundcloud.js +++ b/src/modules/processing/services/soundcloud.js @@ -75,7 +75,7 @@ export default async function(obj) { let fileUrlBase = selectedStream.url; let fileUrl = `${fileUrlBase}${fileUrlBase.includes("?") ? "&" : "?"}client_id=${clientId}&track_authorization=${json.track_authorization}`; - if (fileUrl.substring(0, 54) !== "https://api-v2.soundcloud.com/media/soundcloud:tracks:") + if (!fileUrl.startsWith("https://api-v2.soundcloud.com/media/soundcloud:tracks:")) return { error: 'ErrorEmptyDownload' }; if (json.duration > env.durationLimit * 1000)