Fix guesssong

This commit is contained in:
Dragon Fire
2024-03-22 13:35:35 -04:00
parent f4f1b855c8
commit fee7886675
+2 -1
View File
@@ -127,7 +127,8 @@ module.exports = class GuessSongCommand extends Command {
async fetchAlternativePreview(id) {
const { text } = await request.get(`https://open.spotify.com/embed/track/${id}`);
const $ = cheerio.load(text);
return JSON.parse(decodeURIComponent($('script[id="resource"]')[0].children[0].data)).preview_url;
const body = JSON.parse(decodeURIComponent($('script[id="__NEXT_DATA__"]')[0].children[0].data));
return body.props.pageProps.state.data.entity.audioPreview;
}
shortTrackName(longName) {