Closed TheJerryFox closed 2 years ago
https://github.com/DevSnowflake/soundcloud-scraper/pull/14 I think applying this PR is expected to cause your error to be normally catched through try-catch.
Found out solution!
Change in Client.js in section getPlaylist this:
try {
section = JSON.parse(`[{"id": ${raw.split(`{}})},[{"id":`)[1].split(");")[0]}`);
} catch(e) {
throw new Error(`Could not parse playlist:\n${e.message}`);
}
const data = Util.last(section).data[0];
To this:
try {
section = JSON.parse(`{"hydratable":"playlist" ${raw.split(`},{"hydratable":"playlist"`)[1].split(`"}}];`)[0] + `"}}`}`);
} catch(e) {
throw new Error(`Could not parse playlist:\n${e.message}`);
}
const data = section.data;
Then it works normally as before ;)
Im using the discord-player module for my bot, which uses the soundcloud-scraper module to get soundcloud tracks but they told me to open the issue here: So whenever I give my bot a soundcloud link it will take around 30 seconds for it to give me the following error:
I have not altered anything in the discord-player or soundcloud-scraper module, I tried updating them both but that didn't work either.
Any ideas?