Kodi Community Forum
Custom HTTP headers ? - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: PVR & Live TV Support (https://forum.kodi.tv/forumdisplay.php?fid=167)
+---- Forum: IPTV Simple Client (https://forum.kodi.tv/forumdisplay.php?fid=215)
+---- Thread: Custom HTTP headers ? (/showthread.php?tid=348285)

Pages: 1 2 3 4 5


Custom HTTP headers ? - doucettom - 2019-10-11

Hi,

I am trying to configure IPTV Simple Client to use with my IPTV service. I do have to provide a subid and an stbid as http headers but I don't know how (or if I even can) to do that.

I am able to launch it from my PC with ffplay.

Thanks for your help,


RE: Custom HTTP headers ? - phunkyfish - 2019-10-11

Can you give an example? I.e. how you do it in ffplay today?


RE: Custom HTTP headers ? - doucettom - 2019-10-15

(2019-10-11, 22:28)phunkyfish Wrote: Can you give an example? I.e. how you do it in ffplay today?

With ffplay, it works​ if I use:

ffplay -infbuf -headers $'SUBID:1\r\nSTBID:1\r\n' http://streamer.example.com/live/699/live.m3u8​​

I need those parameters so it can download the DRM key as all channels are DRM'ed

Thanks,


RE: Custom HTTP headers ? - doucettom - 2019-10-15

Ok a little development:

I tried: 
http://streamer.example.com/live/699/live.m3u8|SUBID=1&STBID=1

And this is what I got:
https://paste.kodi.tv/zevitenewe.kodi

I feel I'm getting closer to a working solution though.
BTW I'm using LibreELEC/9.80 HW_RaspberryPi/1.0 App_Bitness/32 Version/19.0-ALPHA1-Git:21ab6c0


RE: Custom HTTP headers ? - phunkyfish - 2019-10-15

Please post a full debug log. Otherwise it’s impossible get any context from your findings.


RE: Custom HTTP headers ? - doucettom - 2019-10-15

Here it is:
https://paste.kodi.tv/wapanaquza.kodi

Thanks for your help,


RE: Custom HTTP headers ? - phunkyfish - 2019-10-15

That’s not a full debug log. You need to enable debug, then restart, repro and post the log. Thanks 😉


RE: Custom HTTP headers ? - phunkyfish - 2019-10-15

FYI, using the “|” approach as you have done above is correct. However kodi does not support non standard http header fields so what you want will not be possible.


RE: Custom HTTP headers ? - doucettom - 2019-10-16

(2019-10-15, 22:32)phunkyfish Wrote: FYI, using the “|” approach as you have done above is correct. However kodi does not support non standard http header fields so what you want will not be possible.

Could I turn this into a feature request ? If yes, how?


RE: Custom HTTP headers ? - phunkyfish - 2019-10-16

The code was changed to only support documented official headers.

Let me ask why.


RE: Custom HTTP headers ? - skydrome - 2019-10-26

adding onto this topic:
Sometimes we need to also pass headers to ffmpeg, but it seems when a url is opened through the pvr client, this code never gets called
https://github.com/xbmc/xbmc/blob/master/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp#L246-L250
whereas if you open the url from kodi it adds all the headers to curl plus ffmpeg

is there a different StreamType that pvr client sets so I could add that to the if statement?


RE: Custom HTTP headers ? - phunkyfish - 2019-10-26

@skydrome I’m afraid that won’t work. The code segment you refer to is when ffmpeg owns the opening of the entire stream. That won’t work for PVR when you want to handle the stream yourself in the addon. iptvsimple uses FFMpeg to open the stream so it applies here.


RE: Custom HTTP headers ? - doucettom - 2019-10-28

(2019-10-16, 23:37)phunkyfish Wrote: The code was changed to only support documented official headers.

Let me ask why.

Had any answer as why ?
I recompiled after adding my own headers and it works.


RE: Custom HTTP headers ? - phunkyfish - 2019-10-28

(2019-10-28, 17:14)doucettom Wrote: Had any answer as why ?
I recompiled after adding my own headers and it works.

Not yet. I understand why the code looks for official headers, that makes sense. But why disallow custom headers is not clear. Some security reason no doubt but appears to be heavy handed way of closing the door.


RE: Custom HTTP headers ? - phunkyfish - 2019-10-29

@skydrome which pvr addon are you using where the correct headers are not being passed?