Dis90 / plugin.video.discoveryplus

discovery+ add-on for Kodi
65 stars 13 forks source link

ZeroDivisionError on video_lastpos and/or video_totaltime #49

Closed Scottes closed 3 years ago

Scottes commented 3 years ago

Tried to play several videos on Discovery+, and they're not playing - I get an error about checking the logs, and this is what I found:

2021-05-22 14:26:13.778 T:6608    ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'ZeroDivisionError'>
                                                   Error Contents: division by zero
                                                   Traceback (most recent call last):
                                                     File "C:\Users\scott\AppData\Roaming\Kodi\addons\plugin.video.discoveryplus\resources\lib\kodihelper.py", line 409, in onPlayBackStopped
                                                       self.update_playback_progress()
                                                     File "C:\Users\scott\AppData\Roaming\Kodi\addons\plugin.video.discoveryplus\resources\lib\kodihelper.py", line 551, in update_playback_progress
                                                       video_percentage = self.video_lastpos * 100 / self.video_totaltime
                                                   ZeroDivisionError: division by zero
                                                   -->End of Python script error report<--

Please let me know if you need anything else.

Dis90 commented 3 years ago

Try restart Kodi. Noticed same error and that was caused because video failed to play because InputStream Adaptive was updated without restarting Kodi.

yeahme49 commented 3 years ago

I'm getting the same issue, using discoveryplus.com. Not sure which site you are using, but the US version is currently broken due to what appears to be a bug in the latest version of inputstream adaptive (errors while trying to load a local m3u8 file). I have an issue opened on that repo, so hopefully it will get resolved.

Scottes commented 3 years ago

Dis90: Restarting did not help. yeahme49: Thanks for the info. I'll keep an eye on that.

Dis90 commented 3 years ago

Thanks to @yeahme49 opening issue to InputStream Adaptive. If possible please fix wrong frame rate in m3u8 file via proxy :) I don't have any knowledge how to do that.

yeahme49 commented 3 years ago

Working on the proxy method and I'll submit a PR when it's done. Should I run everything through the proxy incase other regions need their m3u8 files adjusted for any reason? Or just run US through proxy for now?

Dis90 commented 3 years ago

I think just US is ok for now.

yeahme49 commented 3 years ago

https://github.com/Dis90/plugin.video.discoveryplus/pull/51