r/PowerShell • u/bmsimons • Jan 26 '18
Script Sharing ps-spotify - control Spotify from PowerShell
http://github.com/bmsimons/ps-spotify2
u/dr4kun Jan 26 '18
Thank you for sharing!
Would you be able to provide additional details on filling in the required fields in the .psm1 module file? In particular:
is going through Git and cloning of Git repositories necessary, or would downloading the files and installing them as per regular PowerShell module suffice? My guess is that PowerShell is enough;
based on PowerShell alone, i'm trying to get the BasicBearer, RefreshToken, and AccessToken for the module file; i've created a new app in the Spotify for developers web dashboard and followed your instructions, but i've had trouble using the correct data for the correct field.
In particular - i have the following data:
Client ID;
Client Secret;
How do they translate into BasicBearer / RefreshToken / AccessToken?
Or do i need to authenticate using SpotifyController.cs for authentication first, and only then the module would work at all?
Any step-by-step advise for Git-illiterate person who does know a fair bit of PowerShell and would love a PoSH-based Spotify client would be much appreciated.
1
u/bmsimons Jan 26 '18
Downloading the module as a zip file from GitHub should be perfectly fine. I am also considering to make a screencast to demonstrate the workflow to ease things up a little bit. I am also thinking about including the base64 bearer (client_id:client_secret) within the returned JSON from my dotnet webapp to make things somewhat easier.
0
2
u/_Slusho_ Jan 26 '18
Great work! Do I have to be a Spotify paying subscriber to get this working?
1
1
u/_Slusho_ Jan 27 '18
I got it all set up and I cannot play any music. I get this error:
Invoke-RestMethod : { "error" : { "status" : 403, "message" : "Not available for the current user" } }I miss playing soma.fm through the console on Linux. I was hoping this could fill the void. I could just pay for Spotify but I'm cheap.
23
u/RubiksGamer Jan 26 '18
Pls don't hate on me, but why would you want it?
49
14
u/ReelAwesome Jan 26 '18
detect a crash of some monitored process
play: As the World Falls Down by David Bowie
systems back up
play: Happy by Ferrel
1
7
5
u/codekaizen Jan 26 '18
To turn my Raspberry Pi 3 running Win10 IoT into an internet radio in about 3 minutes?
2
9
u/doomjuice Jan 26 '18
Hey, I'm gonna download it just to find out how it works and that's a win I'd say, so thanks OP. Cool project!
edit: It looks like his site has a good amount of detail (not just on this project) and nicely laid out. Good stuff.
1
7
u/SaltyPeaches Jan 26 '18
I never knew I wanted this. But I do most of my things from the console these days, and I listen to Spotify all day at work. This will be neat to try out!
5
u/VapingSwede Jan 26 '18
I already made our monitoring screen to tell us the error with the dot net speech synthesis. I could se this changing my spotify to some boss fight music if a sev1 would occur :3
Great job, thanks for sharing!
4
5
u/mini4x Jan 26 '18
Fixed a problem that didn't need fixing.
5
3
Jan 26 '18
There was no problem to fix. It’s cool functionality to play around with if you like tinkering with this stuff and he lowered the barrier of entry getting to the cool moment when you punch in a command to PowerShell then your stereo on the other side of the room fires up.
1
u/haleym Jan 26 '18
Disagree, Spotify desktop client is bloated/awful. I’m going to use this as the base for a simple little player UI that can sit in the corner of my desktop and show basic song info/controls.
3
2
u/itmonkey78 Jan 26 '18
Share when you're finished. A mini HTML5 player is something I miss from using Grooveshark all those years ago.
1
1
0
3
u/[deleted] Jan 26 '18
I use this everyday. I couldn’t find an iOS app that would play Spotify as an alarm so I used this to make an alarm together with Task Scheduler. The only draw back is that you have to have Spotify running on a device so it won’t remotely open it. Of course it couldn’t but it’d be nice if it did.
Thanks 🙏 to OP if you’re the creator!