API for get what currently is playing on the server.

I am trying the methods to get what currently is playing on a client and have some problems.

When I connect to the websocket at: ws://localhost:32400/:/websockets/notifications

I get a response that only shows the progress and state of the item not the item itself:

 

{"_elementType":"NotificationContainer","type":"playing","size":1,"_children":[{"_elementType":"PlaySessionStateNotification","sessionKey":"1","viewOffset":0,"state":"playing"}]}

 

And when I connect to the API at: http://IP:PORT/status/sessions

It seems like I only get messages for other users than the owner of the server.

 

What is the best method to get playing items from the server for all users and at least get: item, progress and state?

Not sure what the best method is (as I am not a dev) but I can confirm than using http://IP:PORT/status/sessions reports all remote/local users as well as the PMS owner, providing the clients they are using support the latest 0.9.8 release of PMS.

Well at least it appears to be working correctly for me and the script that I have.

Not sure what the best method is (as I am not a dev) but I can confirm than using http://IP:PORT/status/sessions reports all remote/local users as well as the PMS owner, providing the clients they are using support the latest 0.9.8 release of PMS.
 
Well at least it appears to be working correctly for me and the script that I have.

Strange, it didn't work for me when the client and server was on the same machine.
And I wan't all clients no matter what version they are using since there are loads of different clients out there.

Strange, it didn't work for me when the client and server was on the same machine.
And I wan't all clients no matter what version they are using since there are loads of different clients out there.

It depends on what client you are using, the client needs to support it. PMC/PHT does not yet support it and will not show up there. Yet.

It depends on what client you are using, the client needs to support it. PMC/PHT does not yet support it and will not show up there. Yet.

So the only way to detect that something is playing is still just to parse the logfiles?

So the only way to detect that something is playing is still just to parse the logfiles?

Regarding PHT for a little while longer yes. An update for PHT is coming. Don't know when yet though.

Regarding PHT for a little while longer yes. An update for PHT is coming. Don't know when yet though.


Yeah, but we have ATV, Samsung, Ruku, LG... That won't support this.

Yeah, but we have ATV, Samsung, Ruku, LG... That won't support this.

Yes, there are other clients that needs to get an update as well.

Yes, there are other clients that needs to get an update as well.

I have tested it with PHT and it works great.

It would be great if you could add the itemID to the websocket to instead of just the session id. It is already available for metadata related notifications and would be great for these playback notifications to.

Hi!

I have subscribed for PlexPass and I want to use "Now Playing" but I can't find it anywhere in the API. Where can I find it?

Hi!

I have subscribed for PlexPass and I want to use "Now Playing" but I can't find it anywhere in the API. Where can I find it?

The only thing I am aware of is located at http://localhost:32400/status/sessions  (or your server IP from LAN if local auth is disabled)

The only thing I am aware of is located at http://localhost:32400/status/sessions  (or your server IP from LAN if local auth is disabled)

That is the one to use, correct.

The only thing I am aware of is located at http://localhost:32400/status/sessions  (or your server IP from LAN if local auth is disabled)

"404 Not Found" -.- I have the latest version of Plex Media Server and I was clicking on the link on the same computer that the server is on.

"404 Not Found" -.- I have the latest version of Plex Media Server and I was clicking on the link on the same computer that the server is on.

That should not be happening if you have the latest version of PMS. Can you double check which exact version you have?

That should not be happening if you have the latest version of PMS. Can you double check which exact version you have?

I have recorded a video for you that explains a lot  :) https://www.youtube.com/watch?v=FLzUdPg9OyA

1 Like

"404 Not Found" -.- I have the latest version of Plex Media Server and I was clicking on the link on the same computer that the server is on.

Do you have 'Require authentication on local networks' enabled under WebPlex's Settings->myPlex->Advanced Settings. If you do you will need to add your myPlex user token to the API call:

http://localhost:32400/status/sessions?X-Plex-Token=

Where is obtained by making a call to https://my.plexapp.com:443/users/sign_in.xml and logging in.

Do you have 'Require authentication on local networks' enabled under WebPlex's Settings->myPlex->Advanced Settings. If you do you will need to add your myPlex user token to the API call:

http://localhost:32400/status/sessions?X-Plex-Token=

Where is obtained by making a call to https://my.plexapp.com:443/users/sign_in.xml and logging in.

Thanks! But I'm getting "Plex client headers are required" when I try to get the User Token through a form. Where can I get these headers?

Thanks! But I'm getting "Plex client headers are required" when I try to get the User Token through a form. Where can I get these headers?

Yeah, you will need to set the following headers in the call to https://my.plexapp.com/users/sign_in.xml:

'Content-Length' = 0, 

'X-Plex-Client-Identifier' = 'myPlexApp'
 
See this detailed post from Elan for more info.

Yeah, you will need to set the following headers in the call to https://my.plexapp.com/users/sign_in.xml:

'Content-Length' = 0, 

'X-Plex-Client-Identifier' = 'myPlexApp'
 
See this detailed post from Elan for more info.

Thanks! But I only keep getting a blank page when I have pressed the button with the following code:


            

View the source of the page. The call returns XML with no stylesheet so it may produce empty looking pages in some browsers. If I run this:

curl -H "Content-Length: 0" -H "X-Plex-Client-Identifier: my-app" -u: -X POST https://my.plexapp.com/users/sign_in.xml

Replacing and with my myPlex username and password I get the following back:


  
    
    
  
  DrZeuss
  my email address
  2011-12-17 00:46:32 UTC
  my authentication token