EricRabil / sactivity

Spotify WebSocket Activity API Library
GNU General Public License v3.0
17 stars 1 forks source link

Error 403 #4

Open ElvinGomez opened 3 years ago

ElvinGomez commented 3 years ago

I am getting { error: { status: 403 } }

And this: (node:9542) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'id' of undefined at /Users/quantime/Documents/GitHub/WhatsappBot/node_modules/sactivity/js/SpotifyClient.js:101:93 at Array.reduce (<anonymous>) at SpotifyClient.resolve (/Users/quantime/Documents/GitHub/WhatsappBot/node_modules/sactivity/js/SpotifyClient.js:101:52) at processTicksAndRejections (internal/process/task_queues.js:97:5) at async SpotifyClient.resolveURI (/Users/quantime/Documents/GitHub/WhatsappBot/node_modules/sactivity/js/SpotifyClient.js:104:31)

EricRabil commented 3 years ago

Can you show me your code?

ElvinGomez commented 3 years ago

I copied and paste your test, then search the cookie in the request header that contains a long string with some values like this: sp_m=; spot=; _ga=; sp_adid=; _pin_unauth=; _scid=; sp_dc=; sp_key=; ki_t=; _derived_epik=; &datestamp=&version=6.12.0&hosts=&consentId=&interactionCount=1Path=NotLandingPage&groups==false; sp_phash=; sp_gaid=; sp_ab=; sp_t=; _gcl_au=; sp_last_utm=; sp_landing=; sp_usid=

`import Sactivity, { SpotifyTrackAnalyzer } from 'sactivity';

const sactivity = new Sactivity("cookie"); sactivity.connect().then(socket => { const analyzer = new SpotifyTrackAnalyzer(socket);

analyzer.on('beat', beat => { console.log(beat); });

socket.on('track', async track => { }); }).catch(e => { console.error('Failed to connect to the dealer daddy'); console.error(e); });`