Skip to content

Commit

Permalink
fix preview URL regex
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter-Maguire committed Sep 27, 2024
1 parent 2b26e09 commit 5fca14c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion commands/songguess.js
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ async function getPlaylistData(bot, playlistId){
async function fetchAlternativePreview(id) {
try {
const {data} = await axios.get(`https://open.spotify.com/embed/track/${id}`);
const mp3Preview = /(https:\/\/p\\.scdn\.co\/mp3-preview\/[a-z0-9]*)"/.exec(data);
const mp3Preview = /(https:\/\/p\.scdn\.co\/mp3-preview\/[a-z0-9]*)"/.exec(data.toString());
if(mp3Preview[1])
return mp3Preview[1];
return null;
Expand Down

0 comments on commit 5fca14c

Please sign in to comment.