From 6a8569feb8c562bb8218ecfd72850c3686d96256 Mon Sep 17 00:00:00 2001 From: AtariTom Date: Sun, 24 Sep 2023 13:59:51 -0400 Subject: [PATCH] Fixed find chapter error, soundcloud 403 and watch playlists --- package-lock.json | 4 ++-- package.json | 2 +- play-dl/SoundCloud/index.ts | 8 ++++++-- play-dl/Spotify/index.ts | 14 ++++++++++---- play-dl/YouTube/utils/extractor.ts | 10 ++++++---- 5 files changed, 25 insertions(+), 13 deletions(-) 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('