FTLam11 / Audio-Station-Scrobbler

Got a Synology NAS? Scrobble your music played via Audio Station
MIT License
18 stars 2 forks source link

Status 403 ? #3

Closed gitgetgot closed 6 years ago

gitgetgot commented 7 years ago

Hello,

question before: where is a logfile stored, where I can take a look whats happening? I now use the logfile from the installation process, which was showed in iTerm on my Mac. Is ther a separate logfile on the DS, which we can refer to?

Normal question:

Everything is set up fine (I guess), even the log looks like it is scrobbling, but nothing is updated in the last.fm site.

root@hut:/volume1/public/Audio-Station-Scrobbler# npm start

> audio_station_scrobbler@1.0.0 start /volume1/public/Audio-Station-Scrobbler
> node bin/server.js

[ ✨ scrawble LOG ✨ ] Express server listening on port *:3000

::ffff:192.168.1.22 - - [06/Jul/2017:18:22:10 +0000] "GET /?token=HAYd*********o7D HTTP/1.1" 200 70 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:54.0) Gecko/20100101 Firefox/54.0"
::ffff:192.168.1.22 - - [06/Jul/2017:18:22:10 +0000] "GET /favicon.ico HTTP/1.1" 404 150 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:54.0) Gecko/20100101 Firefox/54.0"
::ffff:192.168.1.22 - - [06/Jul/2017:18:22:10 +0000] "GET /favicon.ico HTTP/1.1" 404 150 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:54.0) Gecko/20100101 Firefox/54.0"
^[[<0;55;15M^[[<32;56;15M^[[<32;57;15M^[[<32;58;15M^[[<32;59;15M^[[<32;60;15M^[[<32;61;15M^[[<32;62;15M^[[<32;63;15M^[[<0;63;15m^[[<0;55;15M^[[<32;56;15M^[[<32;57;15M^[[<32;58;15M^[[<32;59;15M^[[<32;60;15M^[[<32;61;15M^[[<32;62;15M^[[<0;62;15m^[[<0;21;19M^[[<32;22;19M^[[<32;23;19M^[[<32;24;19M^[[<32;25;19M^[[<32;26;19M^[[<32;27;19M^[[<0;27;19m::ffff:192.168.1.22 - - [06/Jul/2017:18:32:10 +0000] "GET /auth/q?api_key=05****************8ae&token=HAYd*********o7D&secret=34**********a9 HTTP/1.1" 200 34 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:54.0) Gecko/20100101 Firefox/54.0"
null
null
null
STATUS: 403
HEADERS: {"server":"openresty/1.9.7.3","date":"Thu, 06 Jul 2017 18:36:05 GMT","content-type":"application/json","connection":"keep-alive","content-length":"85","access-control-allow-methods":"POST, GET, OPTIONS","access-control-allow-origin":"*","access-control-max-age":"86400"}
::1 - - [06/Jul/2017:18:36:05 +0000] "GET /scrobbles/q?artist=Ren%C3%A9+Breitbarth&title=%21 HTTP/1.1" 200 93 "-" "-"
STATUS: 403
HEADERS: {"server":"openresty/1.9.7.3","date":"Thu, 06 Jul 2017 18:38:35 GMT","content-type":"application/json","connection":"keep-alive","content-length":"85","access-control-allow-methods":"POST, GET, OPTIONS","access-control-allow-origin":"*","access-control-max-age":"86400"}
::1 - - [06/Jul/2017:18:38:36 +0000] "GET /scrobbles/q?artist=Akufen&title=03 HTTP/1.1" 200 93 "-" "-"
STATUS: 403
HEADERS: {"server":"openresty/1.9.7.3","date":"Thu, 06 Jul 2017 18:39:10 GMT","content-type":"application/json","connection":"keep-alive","content-length":"85","access-control-allow-methods":"POST, GET, OPTIONS","access-control-allow-origin":"*","access-control-max-age":"86400"}
::1 - - [06/Jul/2017:18:39:10 +0000] "GET /scrobbles/q?artist=Du+Tonc&title=Surging+Memories HTTP/1.1" 200 93 "-" "-"
STATUS: 403
HEADERS: {"server":"openresty/1.9.7.3","date":"Thu, 06 Jul 2017 18:39:19 GMT","content-type":"application/json","connection":"keep-alive","content-length":"85","access-control-allow-methods":"POST, GET, OPTIONS","access-control-allow-origin":"*","access-control-max-age":"86400"}
::1 - - [06/Jul/2017:18:39:19 +0000] "GET /scrobbles/q?artist=Du+Tonc&title=Surging+Memories HTTP/1.1" 200 93 "-" "-"
[ ❌ scrawble ERROR ❌ ] TypeError: Cannot read property 'key' of undefined
    at /volume1/public/Audio-Station-Scrobbler/src/server/auth/authController.js:16:35
    at process._tickCallback (node.js:438:9)
::ffff:192.168.1.22 - - [06/Jul/2017:18:40:08 +0000] "GET /auth/q?api_key=05****************8ae&token=HAYd*********o7D&secret=34**********a9 HTTP/1.1" 500 2 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:54.0) Gecko/20100101 Firefox/54.0"
null
null
STATUS: 403
HEADERS: {"server":"openresty/1.9.7.3","date":"Thu, 06 Jul 2017 18:44:25 GMT","content-type":"application/json","connection":"keep-alive","content-length":"85","access-control-allow-methods":"POST, GET, OPTIONS","access-control-allow-origin":"*","access-control-max-age":"86400"}
::1 - - [06/Jul/2017:18:44:25 +0000] "GET /scrobbles/q?artist=Du+Tonc&title=Surging+Memories HTTP/1.1" 200 93 "-" "-"
STATUS: 403
HEADERS: {"server":"openresty/1.9.7.3","date":"Thu, 06 Jul 2017 18:50:16 GMT","content-type":"application/json","connection":"keep-alive","content-length":"85","access-control-allow-methods":"POST, GET, OPTIONS","access-control-allow-origin":"*","access-control-max-age":"86400"}
::1 - - [06/Jul/2017:18:50:16 +0000] "GET /scrobbles/q?artist=Du+Tonc&title=Surging+Memories HTTP/1.1" 200 93 "-" "-"
^C
schlinkmumpitz commented 7 years ago

Hi, i have the same problem. Any solution for this? maybe lastfm changed sth on their api ?

My fault: sudo did the trick ;)

gitgetgot commented 7 years ago

sudo did the trick PLEASE explain what you did, so others might find this useful too.

FTLam11 commented 6 years ago

@gitgetgot Hey, can you verify if your env.js file has api_key, secret, and sk saved? The [ ❌ scrawble ERROR ❌ ] TypeError: Cannot read property 'key' of undefined points to a potential issue with your session key (sk). According to the log, the plugin is sending the track info to your server, but tracks aren't being scrobbled. I suspect an issue with the session key.

gitgetgot commented 6 years ago

@FTLam11 This is my env.js (####### for some privacy :-) )

process.env['API_KEY'] = '051aa00d87#######ffabc6##ae'
process.env['SECRET'] = '34b242ac7#######4ba9##3dfa9'
process.env['SK'] = 'N90P-QBbwh#######KiPF##cEk'
process.env['API_KEY'] = '05ae200#######04a5ff##638ae'
process.env['SECRET'] = '34be1242a#######4ba95d##fa9'

does that confirm your suspicion?

FTLam11 commented 6 years ago

I think that your scobbling requests to Last.fm are using an invalid api_sig. This field is generated by a combination of your API_KEY and SECRET. If you have the wrong combination, scrobbling won't work. https://www.last.fm/api/show/track.scrobble

You should only have one of each of the following: API_KEY, SECRET, and SK. Need to figure out which ones are correct. Try removing the last two lines of your env.js file (save them to another file) and then restart your NAS to restart the scrobbling server. If that doesn't work, swap out the API_KEY and SECRET and restart your NAS again.

If scrobbling still doesn't work, delete everything in your env.js file and restart the Last.fm authorization process.

gitgetgot commented 6 years ago

Thank you for your kind help. Starting all over did solve the 403 problem. Now, it scrobbles. :-)

FTLam11 commented 6 years ago

@gitgetgot Awesome, glad you were able to get it working!