microlinkhq / spotify-url-info

Get metadata from any Spotify URL.
MIT License
72 stars 15 forks source link

Can't find any data | Never works for me #63

Closed pgamerx closed 3 years ago

pgamerx commented 3 years ago

I keep getting this error again and again. Never works for me My version is latest Screenshot 2020-12-04 at 11 18 06 AM My code is -

               const song = await getPreview(args[0])
               const songname = song.title

it gives error at line - const song = await getPreview(args[0])

How I defined - var { getData, getPreview } = require("spotify-url-info");

crxts commented 3 years ago

I have no trouble getting the info with exactly the same link, have you tried the getTracks method ?

pgamerx commented 3 years ago

Yep ! It gives error saying couldn't parse it or something

crxts commented 3 years ago

have you checked if args[0] gets the given link in full or if it's not set to lowercase ?

pgamerx commented 3 years ago

I checked It gives link only Problem is it works on https://runkit.com but not in my bot

crxts commented 3 years ago

args[0] is not in lowercase ? console.log to be sure

pgamerx commented 3 years ago

I did It's in lowercase

crxts commented 3 years ago

that's why you got an error, links are case sensitive

pgamerx commented 3 years ago

Ohhhh Lemme try it without changing it to lowercase

pgamerx commented 3 years ago

I tried ! Didn't work either

pgamerx commented 3 years ago
   message.channel.send(`Searching for song ! We don't support spotify directly`)
                const args22 = message.content.slice(prefix.length).trim().split(/ +/g);
                const song = await getPreview(args22)
                const songname = song.title
                const search = await distube.search(songname)
                const firststep = search[0].url
                return distube.play(message, firststep)

My code

 Error: Couldn't parse play as valid URL
at getData (/root/Muser/node_modules/spotify-url-info/index.js:13:27)
at module.exports.getPreview (/root/Muser/node_modules/spotify-url-info/index.js:135:36)
at Client.<anonymous> (/root/Muser/bot.js:352:36)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5) | 

My error

pgamerx commented 3 years ago

I was being dumb Issue fixed Thanks

claude-3922 commented 3 years ago

@pgamerxdev how did you fix it?