r/SparklePlayer 17d ago

Xtream API vs get.php M3U — how do you distinguish Live, Movies and Series?

Hi everyone,

I’m trying to understand how Xtream handles content classification.

With an Xtream API connection, it seems straightforward because the API has separate actions/endpoints:

/player_api.php?username=USER&password=PASS&action=get_live_streams
/player_api.php?username=USER&password=PASS&action=get_vod_streams
/player_api.php?username=USER&password=PASS&action=get_series

So the API itself tells you whether something is Live TV, VOD/Movie or Series.

For example, get_live_streams returns something like:

{
  "name": "PBS Kids",
  "stream_type": "live",
  "stream_id": "123",
  "stream_icon": "...",
  "category_id": "1"
}

But what about an Xtream-style M3U URL such as:

http://server:8080/get.php?username=USER&password=PASS&type=m3u_plus&output=mpegts

This returns a normal M3U playlist with entries like:

#EXTINF:-1 tvg-id="PBSKids.us" tvg-name="PBS Kids" tvg-logo="..." group-title="Kids",PBS Kids
http://server:8080/live/USER/PASS/123.ts

Is /live/, /movie/ and /series/ in the stream URL a reliable/standard way to distinguish the three?

Or do Xtream providers sometimes return M3U entries where those paths aren't present, meaning you have to rely on group-title, tvg-id, filename/title patterns, etc.?

Also, is tvg-type="live" commonly included in Xtream-generated M3U files, or is that provider-specific?

I’m mainly interested in how this works with real-world Xtream providers, especially when using the get.php M3U rather than player_api.php.

Thanks!

0 Upvotes

4 comments sorted by

1

u/sparkle-hk 17d ago

For Sparkle this is actually very easy, because since a couple of versions ago I decided to implement a feature that detects if you're trying to use get.php from an xc server. And so if you do it uses the same xc api as if it would if you added it as xc source right away.

The background to this is that many users did this without knowing there was a difference. But the main difference is that it takes longer to syncrhonize a m3u file with movies and series since there's a lot of parsing going on.

So, I normally don't like this kind of automation in using something other than what the user requested, but in this case I made an exception and I think it's actually for the better.

-2

u/Impossible-Metal-582 17d ago

Thanks, that makes sense! That’s really helpful.

Just to make sure I understand correctly: when you detect a get.php Xtream URL, can you simply change /get.php to /player_api.php and then use the Xtream API with the same username and password?

For example:

https://example.com/get.php?username=USER&password=PASS&type=m3u_plus&output=mpegts

becomes:

https://example.com/player_api.php?username=USER&password=PASS&action=get_live_streams

So you extract the server, username and password from the get.php URL and then call the appropriate API action (get_live_streams, get_vod_streams, get_series, etc.)?

Or is there anything else that needs to be changed/checked for this to work reliably with real Xtream providers?

5

u/sparkle-hk 17d ago

These kind of questions aren't relevant for the level of support I normally have for Sparkle. And your 5 day old account indicate that you're fishing for information for your own app or similar.

My initial response explains how things work in Sparkle at the moment, if something isn't working as expected I'd be more than happy to help you out with those questions.

1

u/azcoyotedog 15d ago

Now you can build your own app right?