It is currently April 25th, 2024, 8:31 am

Powershell command error only with Rainmeter

Get help with installing and using Rainmeter.
User avatar
Kaz28100
Posts: 67
Joined: May 3rd, 2012, 3:59 pm
Location: France

Powershell command error only with Rainmeter

Post by Kaz28100 »

Hi :welcome: , i'm using a powershell command to return spotify cover art from Spotify API (since my last.fm version is not reliable), but i have a issue with this one when i use the command by myself on powershell everything works fine. But when i try to paste the same command via rainmeter im getting access token error "only valid bearer authentication supported" or "No token provided".

Its looks like when using rainmeter the auth key are not correctly pasted to powershell

So this is the command i use in Powershell:

Code: Select all

curl.exe -X "GET" "https://api.spotify.com/v1/me/player/currently-playing" -H "Accept:application/json" -H "Content-Type:application/json" -H "Authorization:Bearer MYAUTHTOKEN" -o Spotify.json
With this everything works fine i have all the result i want to my Spotify.json file

And This is rainmeter code i use:

Code: Select all

[mTrack]
Measure=NowPlaying
PlayerName=Spotify
PlayerType=TITLE
OnChangeAction=[!CommandMeasure MeasureRun "Run"]

[MeasureRun]
Measure=Plugin
Plugin=RunCommand
Program=PowerShell
Parameter=curl.exe -X "GET" "https://api.spotify.com/v1/me/player/currently-playing" -H "Accept:application/json" -H "Content-Type:application/json" -H "Authorization:Bearer MYAUTHTOKEN"
State=Show
OutputType=ANSI
OutputFile=#CURRENTPATH#Spotify.json
This is where to get your OAuth Token if you want to take a look by yourself:
https://developer.spotify.com/console/get-users-currently-playing-track/?market=&additional_types=

If anyone have a little idea of what the issue can be?

Edit:I posted this in the wrong category sorry :oops: