I was hoping to find more info on the discover.json and lineup_status.json GETs from Plex’s API. Are those at all related and or is information on them available?
Those aren’t part of the webhook notification system. Those belong to the SiliconDust HDHomeRun HTTP API:
It’s the API Plex uses to communication with SiliconDust’s network tuners (HDHomeRun devices).
discover.json - Returns a list of HDHomeRun tuners available on the local network.
lineup_status.json - Returns information regarding the lineup available to the HDHomeRun (status, type, scan in progress)
Unfortunately SD’s documentation for their API is somewhat incomplete. But it’s generally not necessary unless you’re building an app to interact directly with their tuners.
Is that API restricted to apps to use with a SiliconDust device, and if so is there an alternative for that function? Basically I’m looking to setup an HLS server to emulate a tuner to serve m3u files as Live TV channels
There are several projects in the wild which implement SiliconDust’s proprietary API so as to emulate their tuners’ functionality. For example, see Threadfin (itself a redo of xTeVe):
Also, an additional side question open to anyone: when exactly do the Session id’s get updated for the /status/sessions endpoint? I’m finding that with Mozilla and Edge, the sessions are remaining active after closing the window or tab that has an active stream. It seems to update if explicitly clicking “Stop”, but can’t confirm that’s consistent.
I’ve been using go to just dump the response from /status/sessions, and it takes several minutes for the session from the closed window/tab to be removed from the response. Sometimes I just go back, open the player and click “Stop”. This is the function I setup
package main
import (
"context"
"encoding/json"
"fmt"
"log"
"os"
"github.com/LukeHagar/plexgo"
)
func main() {
ctx := context.Background()
s := plexgo.New(
plexgo.WithServerURL(""),
plexgo.WithSecurity(""),
)
res, err := s.Sessions.GetSessions(ctx)
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
jsonData, err := json.MarshalIndent(res.Object, "", " ")
if err != nil {
log.Fatal(err)
}
if len(res.Object.MediaContainer.Metadata) != 0 {
sessionID := res.Object.MediaContainer.Metadata[0].Session.ID
playerAddress := res.Object.MediaContainer.Metadata[0].Player.Address
fmt.Println(*sessionID)
fmt.Println(*playerAddress)
}
// Print to a file
filename := "plex_sessions.json"
file, err := os.Create(filename)
if err != nil {
log.Fatal("Cannot create file:", err)
}
defer file.Close()
_, err = file.Write(jsonData)
if err != nil {
log.Fatal("Cannot write to file:", err)
}
fmt.Printf("JSON data written to %s\n", filename)
}
}
I’d take anything I found on Reddit with a rather large grain of salt. However, if you trust that that individual does indeed represent their interests, I would certainly defer to them.
Having said that, given that the original question was deleted from that thread, it’s hard to say exactly what they were responding to. Was it someone asking about creating a commercial product? Or was it related to a personal project? Does it matter?
At any rate, this is probably a topic better addressed via their own support resources or forum (they have a development support forum).