diff --git a/package-lock.json b/package-lock.json index 63879ef..550ab7b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "play-dl", - "version": "1.9.6", + "version": "1.9.7", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "play-dl", - "version": "1.9.6", + "version": "1.9.7", "license": "GPL-3.0", "dependencies": { "play-audio": "^0.5.2" diff --git a/package.json b/package.json index 095a9ec..89131ef 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "play-dl", - "version": "1.9.6", + "version": "1.9.7", "description": "YouTube, SoundCloud, Spotify, Deezer searching and streaming for discord-js bots", "main": "dist/index.js", "typings": "dist/index.d.ts", diff --git a/play-dl/SoundCloud/index.ts b/play-dl/SoundCloud/index.ts index e46a13c..42e03ba 100644 --- a/play-dl/SoundCloud/index.ts +++ b/play-dl/SoundCloud/index.ts @@ -111,10 +111,14 @@ export async function stream(url: string, quality?: number): Promise { - const data = await request('https://soundcloud.com/'); + const data: any = await request('https://soundcloud.com/', {headers: {}}).catch(err => err); + + if (data instanceof Error) + throw new Error("Failed to get response from soundcloud.com: " + data.message); + const splitted = data.split('