InputUsername / rescrobbled

MPRIS music scrobbler daemon
GNU General Public License v3.0
232 stars 13 forks source link

Authentication failure #52

Closed tatiee closed 2 years ago

tatiee commented 2 years ago

● rescrobbled.service - An MPRIS scrobbler Loaded: loaded (/usr/lib/systemd/user/rescrobbled.service; disabled; vendor preset: enabled) Active: failed (Result: exit-code) since Wed 2021-11-24 17:05:11 CST; 1min 5s ago Docs: https://github.com/InputUsername/rescrobbled Process: 1467 ExecStart=/home/tev/.cargo/bin/rescrobbled (code=exited, status=1/FAILURE) Main PID: 1467 (code=exited, status=1/FAILURE)

Nov 24 17:05:11 tev-GL62-6QF systemd[3087]: Started An MPRIS scrobbler. Nov 24 17:05:11 tev-GL62-6QF rescrobbled[1467]: Username: Password: Failed to authenticate with Last.fm: Invalid authentication credential Nov 24 17:05:11 tev-GL62-6QF systemd[3087]: rescrobbled.service: Main process exited, code=exited, status=1/FAILURE Nov 24 17:05:11 tev-GL62-6QF systemd[3087]: rescrobbled.service: Failed with result 'exit-code'. ...skipping...

For some reason the notification for entering my Last.fm credentials never pops up when running the program in terminal. I'm on elementary 5.1 Hera

InputUsername commented 2 years ago

Just to confirm, what happens when you stop the service (systemctl --user stop rescrobbled) and then run rescrobbled in your terminal?

tatiee commented 2 years ago

Sorry I'm fairly new to linux - should I just be typing rescrobbled to start the service? Maybe that's where my issue is. I've been running this command systemctl --user start rescrobbled.service then systemctl --user status rescrobbled to pull the information above.

Either way, stopping it and starting it again (with the methods I've been using) shows the same error with no chance to type in my Last.fm credentials. I have the config.toml set up as well with my API token/secret all squared away.

InputUsername commented 2 years ago

No worries! You should simply run rescrobbled in a terminal (no systemctl). That should prompt for a username/password. If that succeeds, you can close the program, and start (or restart) the service.

Let me know if that works!

tatiee commented 2 years ago

Thanks I appreciate it! So I tried that and get "rescrobbled: command not found"

Edit: When I downloaded this version (0.4.0) from crates.io it gives me a warning and I wonder if that has something to do with my problem.

Updating crates.io index Ignored package rescrobbled v0.4.0 is already installed, use --force to override warning: be sure to add /home/tev/.cargo/bin to your PATH to be able to run the installed binaries

I believe I added the PATH correctly though...

InputUsername commented 2 years ago

The warning is expected, it looks like you've installed rescrobbled correctly from crates.io! :)

What is your $PATH variable right now? (eg. echo $PATH) Sometimes you need to log out and log back in again for changes to the path to be reflected.

In any case, you could also run rescrobbled directly using ~/.cargo/bin/rescrobbled. You only have to do this once anyway.

tatiee commented 2 years ago

Awesome, well good to know I made it this far ok!

Here's my $Path

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/bin/cargo:/usr/share/cargo:/usr/share/man/man1/cargo.1.gz

So that looks good (maybe?) - how do I run it directly from the above directory? Just opening the file in Terminal? If so, I tried that and it again just doesn't do anything and gives me the same error message when checking the service status...

InputUsername commented 2 years ago

You should be able to run ~/.cargo/bin/rescrobbled directly in a terminal, does that work?

tatiee commented 2 years ago

Yes! That worked - thank you so much for bearing with me. This is awesome.

InputUsername commented 2 years ago

🎉 happy to help! Hope rescrobbled is useful to you!

tatiee commented 2 years ago

Now playing: Erykah Badu - Appletree (Baduizm) Failed to filter metadata: Failed to run filter script: No such file or directory (os error 2) Failed to run filter script: No such file or directory (os error 2) Player io.elementary.music stopped, looking for a new MPRIS player... Found active player Spot

Here we go again... haha

InputUsername commented 2 years ago

What does your config look like? Do you want to use a filter script? If not, just remove or comment that line in the config file (prefix with #).

I think the only config options that are needed in your case are lastfm-token and lastfm-secret

tatiee commented 2 years ago

lastfm-key = "" lastfm-secret = "" listenbrainz-token = "ListenBrainz API token" enable-notifications = true min-play-time = 0 # in seconds player-whitelist = [] # if empty or ommitted, will allow all players filter-script = "path/to/script"

I'm not sure what a filter script is so if I don't need it then I can take it out.

InputUsername commented 2 years ago

The filter script is useful if you want to modify song information before it is submitted to Last.fm, but yeah it looks like you don't need it in that case! I recommend commenting out (prefix with #) every line in the config besides lastfm-token and lastfm-secret.

(Btw, you might want to remove the actual tokens from your comment, not a big deal but in general you should keep tokens like that a secret 😉 - my bad for not mentioning this)

tatiee commented 2 years ago

Ok great - and no worries! Thanks for looking out on that :) I will comment out the unnecessary settings, but not sure what you mean by (prefix with #) ?

InputUsername commented 2 years ago

If you add # at the start of the line in the config file, that line will be "commented out", ie. not interpreted as configuration options. The result is the same as removing those lines altogether.

Let me know if that works!

tatiee commented 2 years ago

After closing the current process we're up and running - music is scrobbling from both Spot and Music. Perfecto. Thank you so much again, this was incredibly helpful!

InputUsername commented 2 years ago

Awesome, glad it's working for you! 😄

And feel free to make another issue if you have other questions or problems with the program itself.