IPTV : Xtreme Codes vs. Playlist (m3u) & EPG (xml)
With my goal of transforming Zoom Player into the best IPTV player for Windows, I have been diligently working on expanding Zoom Player's feature-set.
I begun working on IPTV specific features when a Zoom Player enthusiast told me that Zoom Player's playlist features were a good starting point for an IPTV player and that he would love to see expanded IPTV features to make the viewing experience even better.
There is barely any documentation on IPTV, so initially, All I was supplied with was a stream playlist and an episode guide sample files. From the files I was able to reverse engineer the protocol structure (extract the meta-data) and wrote custom parsers that were an order of magnitude faster than any standard parsing library, especially for the data in the Electronic Program Guide XML file.
I was really proud of myself. While in some other programs parsing so much data could take anything from 20-60 seconds, after careful optimization in Zoom Player it took under 3 seconds.
As I got the IPTV basics working, I was asked if I could support IPTV Xtreme Codes logins. Again, there was barely any documentation on this. I was able to find a post on github and thought to myself "oh, this is pretty straight forward, I just need to use the 'get.php' and 'xmltv.php' entry points to download the exact same lists I already wrote optimized parsing code for".
I had several people test the new code and it was working great. Then one of the testers got back to me and gave me the bad news, the Xtream Codes feature was not working for him past authentication, the playlist and EPG files were not downloading. I had him run a Zoom Player debug build for logs and found out the hard truth.
The "get.php" and "xmltv.php" entry points were not actually part of the latest Xtream Codes API, but rather remnants of something older. I did some more digging and found this post on github. It appears that to get the same information using the Xtream Codes API requires a more dynamic approach.
Instead of download an entire database as 2 files, I have to change the code to download a subset of the database through the "player_api.php" REST entry point and download some of the remaining data on the fly based on user input. Downloading the entire database using this API would require scraping the server through 100's or even 1000's of queries, a behavior I'm not going to burden the internet with.
The end result is a lot of new complexity. And an actual feature downgrade when using Xtream Codes. You see, by not having the full database on-hand, Zoom Player can't perform global database searches and there's an additional network-lag time to get the EPG data on a stream in real-time.
On the positive side, using Xtream Codes it's technically easier to provide EPG data on previously recorded content such as TV series or Movies.
So if an IPTV provider gives you an option to download the playlist and EPG as direct links or login through Xtream Codes, I would recommend trying both, the experience is not identical.