moreginger / xbmc-plugin.video.ted.talks

GNU General Public License v2.0
18 stars 20 forks source link

Videos not working on Kodi 18.2 #77

Closed arpejupe closed 3 years ago

arpejupe commented 3 years ago

Kodi 18.2-Leia is not playing any videos on Libreelec 9.0.2 Generic.x86_64

2021-03-28 18:25:57.275 T:140003908773632   DEBUG: [ADDON] TED Talks v4.3.1 - url = https://download.ted.com/products/108854.mp4
2021-03-28 18:25:57.275 T:140003908773632   DEBUG: [ADDON] TED Talks v4.3.1 - plot = Living in a city means accepting a certain level of dysfunction: long commutes, noisy streets, underutilized spaces. Carlos Moreno wants to change that. He makes the case for the 15-minute city, where inhabitants have access to all the services they need to live, learn and thrive within their immediate vicinity -- and shares ideas for making urban areas adapt to humans, not the other way around.
2021-03-28 18:25:57.568 T:140004282312448   DEBUG: CWebServer[8080]: request received for /jsonrpc?JSONRPC.Ping
2021-03-28 18:25:57.582 T:140004282312448   DEBUG: Previous line repeats 2 times.
2021-03-28 18:25:57.582 T:140004282312448   DEBUG: CWebServer[8080]: request received for /jsonrpc?Application.GetProperties
2021-03-28 18:25:57.597 T:140003443205888   DEBUG: Previous line repeats 2 times.
2021-03-28 18:25:57.597 T:140003443205888   DEBUG: CWebServer[8080]: request received for /jsonrpc?Player.GetActivePlayers
2021-03-28 18:25:57.843 T:140003908773632   DEBUG: Previous line repeats 2 times.
2021-03-28 18:25:57.843 T:140003908773632   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.KeyError'>
                                            Error Contents: 'introDuration'
                                            Traceback (most recent call last):
                                              File "/storage/.kodi/addons/plugin.video.ted.talks/default.py", line 16, in <module>
                                                ted_talks.Main(args_map=args_map).run()
                                              File "/storage/.kodi/addons/plugin.video.ted.talks/resources/lib/ted_talks.py", line 326, in run
                                                modes[mode].run(self.args_map)
                                              File "/storage/.kodi/addons/plugin.video.ted.talks/resources/lib/ted_talks.py", line 138, in run
                                                self.run_internal(args)
                                              File "/storage/.kodi/addons/plugin.video.ted.talks/resources/lib/ted_talks.py", line 156, in run_internal
                                                self.ui.playVideo(args['url'], args['icon'] if 'icon' in args else None)
                                              File "/storage/.kodi/addons/plugin.video.ted.talks/resources/lib/ted_talks.py", line 71, in playVideo
                                                title, url, subs, info_labels = self.ted_talks.getVideoDetails(url=url, video_quality=settings.video_quality, subs_language=subs_language)
                                              File "/storage/.kodi/addons/plugin.video.ted.talks/resources/lib/ted_talks_scraper.py", line 24, in getVideoDetails
                                                subs = subtitles_scraper.get_subtitles_for_talk(talk_json, subs_language, self.logger)
                                              File "/storage/.kodi/addons/plugin.video.ted.talks/resources/lib/model/subtitles_scraper.py", line 48, in get_subtitles_for_talk
                                                intro_duration = talk_json['player_talks'][0]['introDuration']
                                            KeyError: 'introDuration'
                                            -->End of Python script error report<--
Pyrrhu5 commented 3 years ago

Same issue on Raspbian Buster 10.

Disabling subtitles (ticked grey to the left)in the add-on settings fixes the issue, and the subtitles still load (whut)

Happy debugging ;-)

moreginger commented 3 years ago

That is weird about the subtitles showing when turned off! I think Kodi must consume the old subtitle file? I have done some cleaning up to try and stop that from happening. I've been working to switch to Python 3 for Kodi Matrix, and fix all the issues that have accumulated (see feature/matrix branch). This is a large change as the HTML parser I was using wasn't ported to Matrix. I think everything is working apart from the speakers list now. However, the updated plugin will not support earlier versions.

I'm not really using Kodi actively these days. Is upgrading to Matrix going to be straightforward, or is it something that is likely to drag on for a while?

Pyrrhu5 commented 3 years ago

Is upgrading to Matrix going to be straightforward

I'm still on 18.7, the update from 17 was smooth, no noticeable issues. I will hold off until it's marked as stable (and hold a little more, because I don't want to debug my TV :-p )

I think Kodi must consume the old subtitle file

This is what I thought about the subtitles, but I cleanup the .kodi/temp/*.lwp and .kodi/temp/*.srt and tried a new video. Subtitles loaded :-o

Thought, I think your warning about memory leak if the option is disable is quite on point ^^

hammeronthenet commented 3 years ago

Hi moreginger, I'm looking for a solution or a temporary patch for this video issue (and also to understand the state of the bug). I read a post by user "kodaksmith" on Kodi forum where he suggests to comments two lines on ted-talks-scraper.py. Next of this comments there's a comment by you where you talked about a library (parsedom) that was not ported to Python 3.

I've look further in code and I see that this method call ted subtitles passing id of the video and language, for example compoing an url similar to:

https://www.ted.com/talks/subtitles/id/123/lang/it

This link return a Json file with delays and subtitles to show.

I stopped here with my investigation. So what I don't understand (maybe for my poor english) is:

Thanks a lot, and sorry if I had bothered you.

Dario

EDIT: I see that my log is different:

2021-05-02 18:33:43.590 T:2418008944 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the followi>

  • NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS! Error Type: <type 'exceptions.Exception'> Error Contents: Could not parse HTML: <!DOCTYPE html><> for url 'http://feedproxy.google.com/~r/TEDTalks_video/~3/9_KooZWtaxg/karen_scrivener_a_co> Traceback (most recent call last): File "/storage/.kodi/addons/plugin.video.ted.talks/default.py", line 16, in ted_talks.Main(args_map=args_map).run() File "/storage/.kodi/addons/plugin.video.ted.talks/resources/lib/ted_talks.py", line 326> modes[mode].run(self.args_map) File "/storage/.kodi/addons/plugin.video.ted.talks/resources/lib/ted_talks.py", line 138> self.run_internal(args) File "/storage/.kodi/addons/plugin.video.ted.talks/resources/lib/ted_talks.py", line 156> self.ui.playVideo(args['url'], args['icon'] if 'icon' in args else None) File "/storage/.kodi/addons/plugin.video.ted.talks/resources/lib/ted_talks.py", line 71,> title, url, subs, info_labels = self.ted_talks.getVideoDetails(url=url, video_quality=> File "/storage/.kodi/addons/plugin.video.ted.talks/resources/lib/ted_talks_scraper.py", > raise type(e)(e.message + "\nfor url '%s'" % (url)) Exception: Could not parse HTML: <!DOCTYPE html><> for url 'http://feedproxy.google.com/~r/TEDTalks_video/~3/9_KooZWtaxg/karen_scrivener_a_co> -->End of Python script error report<--
moreginger commented 3 years ago

@hammeronthenet

Thanks for the information, and no problem. There are at least two issues in play:

  1. I want to release a new version of the addon for Matrix, which is a significant upgrade to Kodi and requires all addons to be modified. In my case, the largest issue was that the "parsedom" library was not ported to Matrix, so I have had to use a different HTML parser. I am close to having this ready, but I have problems with playback of certain videos using m3u8 playlists (which have various advantages otherwise).
  2. The current version of the addon requires several updates due to changes to the TED site. The matrix branch has these fixes. They could be ported to the older codebase, but due to the large number of changes required for Matrix it's not completely trivial to do so. I may revisit this once I have the Matrix codebase done, but I don't really want to support two codebases.

In the interim, you may be able to get playback to work by disabling subtitles, which are completely broken due to TED site changes (specifically the code to extract the "introDuration" for the subtitles is broken). I'm not sure from the stack trace above if that will be enough.

So in summary, I hope to have a working addon for Matrix soon, and backporting fixes to older versions of Kodi may happen if I have time, but it's not a priority for me.

moreginger commented 3 years ago

Having not had any more feedback about this, I'm assuming the working matrix version in the kodi repos is sufficient.