hnarayanan / shpotify

A command-line interface to Spotify.
https://harishnarayanan.org/projects/
2.01k stars 153 forks source link

playing song or playlist from uri #74

Open agentfitz opened 7 years ago

agentfitz commented 7 years ago

Awesome utility! Using brew had it working in less than a minute. I saw issue #26 and that is the functionality I was hoping to find.

spotify play list mylist

However, I was thinking I could work around this issue for the time being by manually copying the uri from my playlist and triggering its playback directly with the uri command. I've noticed Spotify gives you two kinds of uris depending how you copy them from their GUI. I have tried them both:

spotify play uri spotify:user:123785495:playlist:2k7wiwTEE0JlN39pvPlpUT and spotify play uri https://open.spotify.com/user/123785495/playlist/1iJoqOMxUxP4IHCqMl2E1N

But neither works for me. I have also tried both style of uris to play a song directly (as opposed to a playlist) without success. Am I using the uri feature incorrectly?

hnarayanan commented 7 years ago

Thanks, and I don't know. 😅 This is not a feature I use, but will check.

dmofot commented 7 years ago

Using spotify play uri <uri> is working for me:

$ spotify play uri spotify:user:dmofot:playlist:7MB1YsnI5HDNnYbjgW7TKy
Playing Spotify URI: spotify:user:dmofot:playlist:7MB1YsnI5HDNnYbjgW7TKy

I also tried the URI you have above and that also works for me:

$ spotify play uri spotify:user:123785495:playlist:2k7wiwTEE0JlN39pvPlpUT
Playing Spotify URI: spotify:user:123785495:playlist:2k7wiwTEE0JlN39pvPlpUT
screen shot 2017-04-27 at 10 55 24 am
agentfitz commented 7 years ago

Hey, thanks for testing that! I find that odd as I haven't been able to have the same success (screenshot below). What operating system are you on?

image

hnarayanan commented 7 years ago

@agentfitz: This doesn't work for me on zsh but works for me on bash.

🤷‍♂️

dmofot commented 7 years ago

OSX Sierra 10.12.4, iTerm2 Build 3.0.15, GNU bash, version 4.4.12(1)-release (x86_64-apple-darwin16.3.0)

hnarayanan commented 7 years ago
screen shot 2017-04-27 at 4 07 31 pm
agentfitz commented 7 years ago

Interesting, just tried switching to bash and had the same result. Odd.

OSX El Capitan Version: 10.11.5 (15F34)

image

dmofot commented 7 years ago

Hmm, can you check a couple of things?

  1. Does it work if you quote the <uri>, i.e. "spotify:user:123785495:playlist:2k7wiwTEE0JlN39pvPlpUT"?
  2. If you put the <uri> directly into the search box in the Spotify app, does that work? screen shot 2017-04-27 at 11 25 33 am

The first one works for me. The second one also works if I paste the <uri> in and just hit enter.

agentfitz commented 7 years ago

Using quotes doesn't work (tried that earlier too), pasting into spotify search box does work.

image

image

hnarayanan commented 6 years ago

Did you guys manage to reach some sort of conclusion on this?

dmofot commented 6 years ago

I just updated to shpotify 2.0 and tried spotify play uri <uri> and it still works for me. spotify play list <list> still doesn't return any results, which doesn't surprise me given there is no list commands in the Spotify.sdef file. That command should probably be removed...

OSX Sierra 10.12.6 iTerm2 Build 3.1.4 GNU bash, version 4.4.12(1)-release (x86_64-apple-darwin16.3.0)

screen shot 2017-11-05 at 11 55 12 am

dkniffin commented 6 years ago

For what it's worth, it works on both zsh and bash for me:

screen shot 2018-04-29 at 8 23 06 pm