anxdpanic / plugin.video.twitch

Watch your favorite gaming streams on Kodi
https://twitchaddon.page.link/forum
271 stars 79 forks source link

Past broadcasts randomly fail to open #346

Closed hewwra closed 6 years ago

hewwra commented 6 years ago

http://paste.ubuntu.com/26019554/

Sometimes when I try to watch a vod it wont start, see log above.

It seems to be some certificate issue related to fastly.vod.hls.ttvnw.net. I have checked the log files when the vod starts without a problem. In this case kodi tries to open the vod from akamaized.net or vod.edgecast.hls.ttvnw.net.

I guess this is a problem on some servers on Twitch but can a workaround be created or perhaps contact twitch?

anxdpanic commented 6 years ago

On Twitch's end the certificate is in good standing with no chain issues, and it is working here fine. Kodi 17.6, and 18 on Windows 10 and OSMC

Looks like a local issue to your os/install. Would start by checking for windows updates and update kodi to 17.6. Also can take a look, https://support.microsoft.com/en-us/help/931125/how-to-get-a-root-certificate-update-for-windows

hewwra commented 6 years ago

I upgraded to Kodi 17.6 & updated windows but the issue is still the same. I tried going to https://fastly.vod.hls.ttvnw.net in chrome it says that the certificate is ok.

Perhaps there are more servers hiding behind fastly.vod.hls.ttvnw.net and you get one that is local to where ever you are in the world and the issue is with that specific server?

This may or may not be related but I use another program called Twitch Leecher (downloads Twitch vods) and they also had some issues related to certificates/SSL, and they managed to solve it take a look: https://github.com/Franiac/TwitchLeecher/issues/183

Anyway we could just leave this issue open and see if more people have that same problem?

anxdpanic commented 6 years ago

No way to control ssl at the player level in Kodi that I am aware of. I did notice that the mimetype responses are returning and happen multiple times, so I've added an update to set the mimetype so those don't happen as they may be causing an issue with the final request.

The update (alpha) is available here if you want to give that a try.

hewwra commented 6 years ago

I tried the alpha but sadly got the same error.

hewwra commented 6 years ago

I compared the certs from vod058-ttvnw.akamaized.net, vod.edgecast.hls.ttvnw.net and fastly.vod.hls.ttvnw.net and one difference between them is something called "X25519".

Kodi seems to be using Openssl version 1.0.2l https://github.com/xbmc/xbmc/blob/18.0a1-Leia/tools/depends/target/openssl/Makefile However X25519 was not supported in Openssl until version 1.1.0 https://www.openssl.org/news/openssl-1.1.0-notes.html

So is this the problem? Maybe confirm this with some Kodi dev and ask them if there is a reason why they don't use version 1.1.0 or later?

anxdpanic commented 6 years ago

Sorry I hadn't seen this, still not sure why I was having no issues with those videos on 2 different platforms including Windows. It looks like the video in the last debug log is no longer available, do you happen to have another video or two that this happens on?

hewwra commented 6 years ago

There is no specific video where this happens, a past broadcast can fail and if I then restart Kodi and try to open it again it loads just fine. But when it does fail it always says in the debug log file that it failed on fastly.vod.hls.ttvnw.net. But since you asked I just tried imaqtpie's latest past broadcast and it failed.

You should be able to encounter this bug by just open a random past broadcast and if it starts just close it and try to open another past broadcast and so on until it fails.

It would be great if you could verify from logs that you can actually open vods from fastly.vod.hls.ttvnw.net.

anxdpanic commented 6 years ago

Verified that I have no issues playing from fastly.vod.hls.ttvnw.net Windows 10: Kodi 15.2-18a OSMC: Kodi 18a

hewwra commented 6 years ago

I set up some virtual machines and did some testing with Kodi 17.6 :

Windows 10 x64: I could open vods from fastly.vod.hls.ttvnw.net Windows 7 x64: I could not open vods from fastly.vod.hls.ttvnw.net , same error as on my regular htpc

So it seems to be a problem with Windows 7, do you have any way of confirming this?

Someone else also seems to have a similar problem with fastly.vod.hls.ttvnw.net link

anxdpanic commented 6 years ago

I don't have a way to confirm atm, and not sure it's something I can resolve with the add-on. It's on my list, but it's probably going to be a while before I get to it. Python 3 compat and new helix api are due, along with working on the YouTube add-on and I only have so much free time. I'll add a help wanted tag in the meantime.

hewwra commented 6 years ago

I don't think this is something that can be resolved in this addon either but if there is an issue with Win7+ certain certificates in Kodi it will impact every addon where this type of certificate is used. So for example if Youtube adds this type of certificate to their services there could potentially be a lot of complaints.

anxdpanic commented 6 years ago

@hewwra Can you test the changes of #381 with the latest Kodi 18 nightly, a curl option to disable certificate verification was recently added https://github.com/MrSprigster/Twitch-on-Kodi/pull/381/files

hewwra commented 6 years ago

I have tested it and it works! Thx for fixing it.

anxdpanic commented 6 years ago

👍 I seen the PR for the option, and immediately thought of this. Thanks for testing and confirming.