mirror of
https://github.com/wukko/cobalt.git
synced 2024-11-15 04:39:58 +00:00
soundcloud: use startsWith instead of substring
This commit is contained in:
parent
c6f1184e55
commit
40b00a9676
1 changed files with 1 additions and 1 deletions
|
@ -75,7 +75,7 @@ export default async function(obj) {
|
||||||
let fileUrlBase = selectedStream.url;
|
let fileUrlBase = selectedStream.url;
|
||||||
let fileUrl = `${fileUrlBase}${fileUrlBase.includes("?") ? "&" : "?"}client_id=${clientId}&track_authorization=${json.track_authorization}`;
|
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' };
|
return { error: 'ErrorEmptyDownload' };
|
||||||
|
|
||||||
if (json.duration > env.durationLimit * 1000)
|
if (json.duration > env.durationLimit * 1000)
|
||||||
|
|
Loading…
Reference in a new issue