ledesmablt / spotify-cli

Control Spotify playback on any device through the command line.
MIT License
116 stars 15 forks source link

Operation restricted for the active device error on volume change in bash #18

Closed illiakozey closed 3 years ago

illiakozey commented 3 years ago

When trying to change volume by the $ spotify-cli v up/down/to 50 command, an error Error: Operation restricted for the active device. appears

ledesmablt commented 3 years ago

Hi @illiakozey , the volume command in particular is expected to not work for mobile (noted in readme here). I'm not sure why the Spotify API doesn't work here, but my guess is that Spotify mobile depends only on device volume (no in-app volume), as opposed to the web and desktop client which both depend on your system volume and the Spotify app's volume levels.

I'd say this isn't a bug on the cli or the API since we can't expect Spotify to be able to hijack your system volume =)

illiakozey commented 3 years ago

hmm, but an error appears when im trying to change volume using bash on desktop Spotify client

ledesmablt commented 3 years ago

Can you run spotify status -vv and confirm that your device is indeed the desktop client?

If so, are you using Spotify premium? Docs state that non premium users will get an error message, though I haven't tested this before

illiakozey commented 3 years ago

yes, an output says Device dhcpph4 (Computer) + im not using Spotify premium

ledesmablt commented 3 years ago

Okay, so that means the error is due to you not using Spotify premium. Can't really help with this since this is a limitation they set in their API. Thanks for raising this though!