Authenticated HLS Streams Not Working

Hello,

I believe authenticated HLS streams are now broken in Kodi 17 for Neulion.

Logs: http://pastebin.com/uCd0PT7C

As I understand it, Kodi now takes a more ffmpeg-like approach to starting an HLS stream, by requesting each sub-stream m3u8 and then probing the sub-stream segments. I think this creates a problem with certain providres, such as Neulion. I can see in the logs that the first five requests for the keys (one at each of the first five bitrates) succeeds, but the last request fails, and then we abort the entire attempt to play.

I think what is happening is that the provider might see the same key requested so many times, and then expire the session token (in the cookie).

To work around this, I imagine addon maintainer such as myself could parse the top-level m3u8 and only pass one bitrate to kodi, but that isn’t a great option.

Anyway, I’ve got a little experience in FFMPEG’s HLS demuxer, a little experience with Kodi, but my time is limited and I think we’re close to release with a serious regression. If someone more familiar wants to take a look they can reach out to me for credentials to gain access to a stream.