http get request headers in playlist items
#1
Hi,

I am currently working on an addon which emulates the TV archive functionality of my ISP's set-top-box. I have managed to pass some series of autentification (vlan, special request headers etc.) in python code. Now I am about to create an M3U8 playlist for the stream, but the issue is that I have to use special autentification header to be able to watch the stream.

I know that topic of request headers have been discussed here several time and XBMC can add headers if written in this format: URL|header1=value1&header2=value2 etc.This works great when using xbmcplugin.addDirectoryItem() method... But I cannot use this approach as the shows in the archive are segmented in several 10 seconds files for which I have to create a playlist (M3U8). As I have found out XBMC is unable to open a M3U8 playlist if I append headers to the URL for XBMC like this:

Code:
#EXT-X-VERSION:3
#EXTM3U
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:0

#EXTINF:10.0, no desc
http://some_host:port/2269403.ts|Autentification=TC sfsai8oexe89xa

#EXTINF:10.0, no desc
http://some_host:port/2269404.ts|Autentification=TC sfsai8oexe89xa

#EXT-X-ENDLIST

I get following in xbmc log:
Code:
20:42:41 T:139839295313792  NOTICE: DVDPlayer: Opening: /storage/videos/playlistTest.m3u8
20:42:41 T:139839295313792 WARNING: CDVDMessageQueue(player)::Put MSGQ_NOT_INITIALIZED
20:42:41 T:139836610373376  NOTICE: Thread DVDPlayer start, auto delete: false
20:42:41 T:139836610373376  NOTICE: Creating InputStream
20:42:41 T:139836610373376  NOTICE: Creating Demuxer
20:42:41 T:139836610373376   ERROR: Open - Error, could not open file /storage/videos/playlistTest.m3u8
20:42:41 T:139836610373376   ERROR: OpenDemuxStream - Error creating demuxer
20:42:41 T:139836610373376  NOTICE: CDVDPlayer::OnExit()
20:42:41 T:139836610373376  NOTICE: CDVDPlayer::OnExit() deleting input stream
20:42:41 T:139839295313792   ERROR: Playlist Player: skipping unplayable item: 0, path [/storage/videos/playlistTest.m3u8]
20:42:41 T:139836610373376  NOTICE: Thread BackgroundLoader start, auto delete: false
20:42:41 T:139839295313792  NOTICE: CDVDPlayer::CloseFile()

After I remove the xbmc header part I get following errors (server refuses connection due to missing autentification header)
Code:
22:13:44 T:139836660729600   ERROR: Open - error probing input format, /storage/videos/playlistTest.m3u8
22:13:44 T:139836660729600   ERROR: OpenDemuxStream - Error creating demuxer

Any suggestions how to solve the issue?
thx
Reply
#2
m3u8 is special playlist used for HLS. Xbmc won't even read it direct so you can't this stuff here (also, it's not formatted correctly. " #EXTM3U" should be first line). Try creating a .strm (wiki) file and add the url to the .m3u8 in this file. Then add |header in the same file.
Reply
#3
Thanx for reply.
Is there a way how to tell xbmc how long streams will last in .strm separately and alltogether? Each segment in my case is 10 seconds long. I have there a 360 ten second long files for an 1 hour show.
Reply
#4
you don't have to that. xbmc will figure out the total duration
Reply
#5
I tried the .strm file. Streams work, but it doesn't feel right. There is a short gap with black screen every 10 seconds when xbmc switches to next segment, it changes language stream back to stream default with each opened segment, I cannot fast forward or I don't know lenght of whole stream... The connection is very fast and whole segment in in the buffer in first second of the segment. It's pity that next segment is not buffered in advance.

Any other suggestions?
Reply

Logout Mark Read Team Forum Stats Members Help
http get request headers in playlist items0