s0faking / plugin.video.orftvthek

ORF TVthek - This KODI plugin provides access to the Austrian "ORF TVthek"
GNU General Public License v2.0
42 stars 19 forks source link

Error getting getNewShows/getSendungen #137

Closed killerbees19 closed 6 months ago

killerbees19 commented 6 months ago

System: Kodi 20.3 (LibreELEC 11.0) Plugin version: master (128418e7203bb765a023d29000a2b9b7fd233567)

ORF ON addon (master branch) works as expected, but ORF TVthek addon can't load (Neueste) Sendungen or anything else (except Live) anymore.

2024-05-14 16:03:43.316 T:4626    debug <general>: Service API activated
2024-05-14 16:03:43.316 T:4626    debug <general>: ServiceAPI  - Init done
2024-05-14 16:03:46.708 T:946     debug <general>: ------ Window Deinit (DialogNotification.xml) ------
2024-05-14 16:03:55.242 T:4626    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: 'NoneType' object has no attribute 'get'
                                                   Traceback (most recent call last):
                                                     File "/storage/.kodi/addons/plugin.video.orftvthek/default.py", line 6, in <module>
                                                       Addon.run()
                                                     File "/storage/.kodi/addons/plugin.video.orftvthek/resources/lib/Addon.py", line 150, in run
                                                       scraper.getNewest()
                                                     File "/storage/.kodi/addons/plugin.video.orftvthek/resources/lib/ServiceApi.py", line 132, in getNewest
                                                       self.getTableResults(self.__urlNewest)
                                                     File "/storage/.kodi/addons/plugin.video.orftvthek/resources/lib/ServiceApi.py", line 150, in getTableResults
                                                       self.__JSONEpisode2ListItem(result)
                                                     File "/storage/.kodi/addons/plugin.video.orftvthek/resources/lib/ServiceApi.py", line 510, in __JSONEpisode2ListItem
                                                       self.JSONImage(JSONEpisode.get('_embedded').get('image')),
                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                     File "/storage/.kodi/addons/plugin.video.orftvthek/resources/lib/ServiceApi.py", line 173, in JSONImage
                                                       return jsonImages.get('public_urls').get('highlight_teaser').get('url')
                                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                   AttributeError: 'NoneType' object has no attribute 'get'
                                                   -->End of Python script error report<--

2024-05-14 16:03:55.242 T:4626    debug <general>: onExecutionDone(40, /storage/.kodi/addons/plugin.video.orftvthek/default.py)
2024-05-14 16:03:55.255 T:946     debug <general>: ------ Window Init (DialogNotification.xml) ------
2024-05-14 16:03:55.308 T:4626    debug <general>: Python interpreter stopped
2024-05-14 16:03:55.308 T:4626    debug <general>: Thread LanguageInvoker 139710689162944 terminating
2024-05-14 16:03:55.308 T:4625    error <general>: GetDirectory - Error getting plugin://plugin.video.orftvthek/?link&mode=getNewShows
s0faking commented 6 months ago

looks like there have been quite a few changes on the api (V3 which is actually an old version, but the changes applied here anyway as it seems). i tried a quick fix, most stuff seems to work but assets on the "Sendungen" category are left out because they would require an api request per show to fetch all the image data needed. upgrading the api version to a newer one would require quite a rewrite because the structure changed significantly, but the plan is to replace the tvthek addon with the orfon addon anyway. I still have to decide if i will replace the code on the old addon and leave the name (at least the addon system id or if i push the orf on addon as a brand new addon. not sure yet what the kodi addon policies are on changing the name for the addon. The original plan was to do that in april, but there is a little sofaking on the way so i've been quite busy with preperations and work :)

killerbees19 commented 6 months ago

Thank you, @s0faking! 🥳