2013-10-15, 03:22
I can confirm that running an external webserver works great!
(2013-10-15, 15:05)Hyperium Wrote: Ok, wait a minute. Carb0 is not downloading the .m3u8 file every 10 seconds. The .ts files are predictable therefore he creates only ONE file. He just fills the entire file full of what it already expects. Check out the newest GCL and as soon as it asks for the home or away feed, go to your plugin.video.GCL etc.. and check for yourself. Look in the home.m3u8 file and you'll see what I mean.
Edit: I see now, this is super easy. You can download this mongoose server temporarily, until carb0 adds a HTTP server through XBMC. What you do is just add your folder path to the document_root path in mongoose ( C:\Users\Hyperium\AppData\Roaming\XBMC\addons\plugin.video.nhl-gamecenter\m3u8 )
Replace this string in gamecenter.py * Not sure if it's exactly right, but it should be close -- pathToKey.append(os.path.join("http://localhost:8080/" + filename + str(i) + ".m3u8.key"))
And that should do it temporarily for Windows users.
(2013-10-15, 16:41)juggie Wrote: Not necessarily downloading no, but he writes the file on a python threading.timer() every 10 seconds. I have no idea how often the xbmc player requests it. But ultimately it does result in a collision when the file is being written at the same time as xbmc player is reading it.
(2013-10-15, 16:41)juggiilpid=1528405 Wrote:(2013-10-15, 15:05)Hyperium Wrote: Ok, wait a minute. Carb0 is not downloading the .m3u8 file every 10 seconds. The .ts files are predictable therefore he creates only ONE file. He just fills the entire file full of what it already expects. Check out the newest GCL and as soon as it asks for the home or away feed, go to your plugin.video.GCL etc.. and check for yourself. Look in the home.m3u8 file and you'll see what I mean.
Edit: I see now, this is super easy. You can download this mongoose server temporarily, until carb0 adds a HTTP server through XBMC. What you do is just add your folder path to the document_root path in mongoose ( C:\Users\Hyperium\AppData\Roaming\XBMC\addons\plugin.video.nhl-gamecenter\m3u8 )
Replace this string in gamecenter.py * Not sure if it's exactly right, but it should be close -- pathToKey.append(os.path.join("http://localhost:8080/" + filename + str(i) + ".m3u8.key"))
And that should do it temporarily for Windows users.
Not necessarily downloading no, but he writes the file on a python threading.timer() every 10 seconds. I have no idea how often the xbmc player requests it. But ultimately it does result in a collision when the file is being written at the same time as xbmc player is reading it.
I was going to add the the micro http server into the old version of the addon but I only found it on the svn server right before I went to bed. I may give it a shot tonight during the games when I can test it. I did however write the http proxy in python last night before going to sleep. It already rewrites the .m3u8 file when requested to include the new key location (essentially to point back at the proxy). I just need to modify the old version of GCL to point at the proxy and see if it works. if that works then I'll integrate it into the addon and test it.
What I don't know (not being familiar with XBMC addons) is what the life of a python addon is. Eg, do components of the addon run the entire time you are within the addon (initial observation is no) or does the whole thing refresh on each new page. Eg going from Main screen -> Live games page would reload the whole thing. Based on my initial observations this appears to be the case. Obviously things keep running while in the playback as Carb0 was able to use that to keep updating the m3u8 file. I know python well but the within xbmc is new to me.
In any case time permitting I will work on this during the live games tonight.
(2013-10-15, 17:06)Hyperium Wrote: Interesting, I must've missed that part. Although, I'm also not a python coder so I don't know 100% of what I'm looking at. And to the guy who has the stutter, I would guess if the stopping and starting follows an exact pattern, for example every 'x's amount of time, I would assume that would be the cause.
(2013-10-15, 16:41)juggie Wrote: Not necessarily downloading no, but he writes the file on a python threading.timer() every 10 seconds. I have no idea how often the xbmc player requests it. But ultimately it does result in a collision when the file is being written at the same time as xbmc player is reading it.
I was going to add the the micro http server into the old version of the addon but I only found it on the svn server right before I went to bed. I may give it a shot tonight during the games when I can test it. I did however write the http proxy in python last night before going to sleep. It already rewrites the .m3u8 file when requested to include the new key location (essentially to point back at the proxy). I just need to modify the old version of GCL to point at the proxy and see if it works. if that works then I'll integrate it into the addon and test it.
What I don't know (not being familiar with XBMC addons) is what the life of a python addon is. Eg, do components of the addon run the entire time you are within the addon (initial observation is no) or does the whole thing refresh on each new page. Eg going from Main screen -> Live games page would reload the whole thing. Based on my initial observations this appears to be the case. Obviously things keep running while in the playback as Carb0 was able to use that to keep updating the m3u8 file. I know python well but the within xbmc is new to me.
In any case time permitting I will work on this during the live games tonight.
(2013-10-15, 17:22)juggie Wrote: If you take a look at def LIVELINKS(..) you can see the m3u8 file is downloaded using the download function, then a timer is started to expire in 10 seconds. Inside that function there is logic to write the m3u8 and then set the time for another 10 seconds. This loop of every 10 seconds continues as long as video is being played back and will stop when you are not.
I'd rather let the far end server do what it is supposed to do and provide the m3u8 when ever xbmc chooses to request it. All we have to do to fix the unfortunate issue is act as a middle man so that we can ensure the proper User-Agent is passed on the request for the .key file.
Has anyone submitted a bug to the bug tracker for this? The exact issue is that while you can pass |User-Agent=foo on to the xbmc player. It does not pass User-Agent=foo when it does the request for the key which it reads from the m3u8.
(2013-10-15, 17:50)Carb0 Wrote: As far as I know the player downloads the last 3 ts files (30 seconds buffer) and then starts to play the stream. To be 'sure' that a new ts file exists I have to wait at least 10 seconds until I can update the m3u8 file. And the XBMC player probably requests the m3u8 file even more frequently to keep the buffer constantly at 3 ts files.
It got the server working inside of the add-on but I don't know how to stop it when you leave the add-on and restart the server when you open the add-on again. I always get a sockets error.
Yes, the whole thing refreshes when you click on a category. If you could work on this that would be nice. I live in Europe and can't stay up every night just to test the add-on and the streams from last night already stopped working.
It would definitely be a nicer solution to use the server. Apok said that he's working on a fix.