moreginger / xbmc-plugin.video.ted.talks

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

Exception: Could not parse HTML. #80

Closed candlethorp closed 2 years ago

candlethorp commented 2 years ago

Hey my ted talks plugin for kodi stopped working recently. You guys got a fix?

log attached.

updated kodi, updated linux mint. I can see the video descriptions and image but when i try and play them it errors out.

2022-02-08 18:26:39.948 T:1701     INFO <general>: Starting Kodi (19.3 (19.3.0) Git:20211024-49a04cd6a7). Platform: Linux x86 64-bit
2022-02-08 18:26:39.948 T:1701     INFO <general>: Using Release Kodi x64
2022-02-08 18:26:39.948 T:1701     INFO <general>: Kodi compiled 2021-10-24 by GCC 9.3.0 for Linux x86 64-bit version 5.4.143 (328847)
2022-02-08 18:26:39.948 T:1701     INFO <general>: Running on Linux Mint 20, kernel: Linux x86 64-bit version 5.4.0-99-generic
2022-02-08 18:26:39.948 T:1701     INFO <general>: FFmpeg version/source: 4.3.2-Kodi

2022-02-08 18:29:58.061 T:1917     INFO <general>: [ADDON] Initialized TED Talks v5.0.0 using Python: 3.8.10 (default, Nov 26 2021, 20:14:08) 
                                                   [GCC 9.3.0]'
2022-02-08 18:29:58.061 T:1917    DEBUG <CAddonSettings[plugin.video.ted.talks]>: trying to load setting definitions from old format...
2022-02-08 18:29:58.061 T:1917    DEBUG <CSettingsManager>: requested setting (video_quality) was not found.
2022-02-08 18:29:58.184 T:1701    DEBUG <general>: ------ Window Init (DialogBusy.xml) ------
2022-02-08 18:29:58.410 T:1917    DEBUG <general>: [ADDON] TED Talks v5.0.0 - url = https://www.ted.com/talks/susan_ruffo_the_ocean_s_ingenious_climate_solutions?rss=172BB350-0205
2022-02-08 18:29:58.410 T:1917     INFO <general>: [ADDON] TED Talks v5.0.0 - GET https://www.ted.com/talks/susan_ruffo_the_ocean_s_ingenious_climate_solutions?rss=172BB350-0205
2022-02-08 18:29:58.757 T:1917    ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'AttributeError'>
                                                   Error Contents: 'Exception' object has no attribute 'message'
                                                   Traceback (most recent call last):
                                                     File "/home/htpc/.kodi/addons/plugin.video.ted.talks/resources/lib/ted_talks_scraper.py", line 17, in get_video_details
                                                       m3u8_url, title, speaker, plot, talk_json = talk_scraper.get_talk(talk_html, self.logger)
                                                     File "/home/htpc/.kodi/addons/plugin.video.ted.talks/resources/lib/model/talk_scraper.py", line 14, in get_talk
                                                       raise Exception('Could not parse HTML.')
                                                   Exception: Could not parse HTML.

                                                   During handling of the above exception, another exception occurred:

                                                   Traceback (most recent call last):
                                                     File "/home/htpc/.kodi/addons/plugin.video.ted.talks/default.py", line 14, in <module>
                                                       ted_talks.Main(args_map=args_map).run()
                                                     File "/home/htpc/.kodi/addons/plugin.video.ted.talks/resources/lib/ted_talks.py", line 336, in run
                                                       modes[mode].run(self.args_map)
                                                     File "/home/htpc/.kodi/addons/plugin.video.ted.talks/resources/lib/ted_talks.py", line 148, in run
                                                       self.run_internal(args)
                                                     File "/home/htpc/.kodi/addons/plugin.video.ted.talks/resources/lib/ted_talks.py", line 166, in run_internal
                                                       self.ui.playVideo(args['url'], args['icon'] if 'icon' in args else None)
                                                     File "/home/htpc/.kodi/addons/plugin.video.ted.talks/resources/lib/ted_talks.py", line 71, in playVideo
                                                       playlist, title, subs, info_labels = self.ted_talks.get_video_details(url=url, subs_language=subs_language)
                                                     File "/home/htpc/.kodi/addons/plugin.video.ted.talks/resources/lib/ted_talks_scraper.py", line 19, in get_video_details
                                                       raise type(e)(e.message + "\nfor url '%s'" % (url))
                                                   AttributeError: 'Exception' object has no attribute 'message'
                                                   -->End of Python script error report<--

2022-02-08 18:29:58.757 T:1917    DEBUG <general>: onExecutionDone(13, /home/htpc/.kodi/addons/plugin.video.ted.talks/default.py)
2022-02-08 18:29:58.770 T:1701    DEBUG <general>: ------ Window Init (DialogNotification.xml) ------
2022-02-08 18:29:58.785 T:1917    DEBUG <general>: .
2022-02-08 18:29:58.843 T:1917     INFO <general>: Python interpreter stopped

full kodi debug log is here: https://pastebin.com/raw/7rri1fZN

kevwag commented 2 years ago

@candlethorp There's a manual fix posted in the Kodi forum which involves editing four of the py files. I wouldn't expect the released version on here or in the Kodi repo to be fixed any time soon - the manual fix has been available since 2016 and the developer still hasn't applied it to the addon release.

candlethorp commented 2 years ago

sorry do you have a link to that modification? i mean it worked fine till recently.

kevwag commented 2 years ago

sorry do you have a link to that modification? i mean it worked fine till recently.

I can do better than that. I've fixed the addon and posted it as a release on my GitHub page. Download the package HERE.

I've also sent the dev a pull request so the fixes can be pushed to the Kodi repo.

candlethorp commented 2 years ago

ok! thats done it kevwag! i deleted the plugin at file path /home/USERNAME/.kodi/addons/ and replaced it with your modified one. The ted talk plugin now works. Excellent fix! thanks.

strk commented 1 year ago

The official repository still has the broken version as far as I can tell, shouldn't this ticket be re-opened ?