putdotio / putio-kodi

Official Put.io Kodi addon
GNU General Public License v3.0
11 stars 2 forks source link

Playback fails on Xbox Kodi 19.4 #16

Closed dmitrc closed 1 month ago

dmitrc commented 2 years ago

This is the error I get when attempting to play any media file:

2022-04-21 00:17:04.709 T:5424     INFO <general>: initializing python engine.
2022-04-21 00:17:06.116 T:5424    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: 'dict' object has no attribute 'status_code'
                                                   Traceback (most recent call last):
                                                     File "Q:\Users\UserMgr0\AppData\Local\Packages\XBMCFoundation.Kodi_4n2hpmxwrvr6p\LocalState\addons\plugin.video.putio\main.py", line 217, in <module>
                                                       main()
                                                     File "Q:\Users\UserMgr0\AppData\Local\Packages\XBMCFoundation.Kodi_4n2hpmxwrvr6p\LocalState\addons\plugin.video.putio\main.py", line 211, in main
                                                       play(item=item)
                                                     File "Q:\Users\UserMgr0\AppData\Local\Packages\XBMCFoundation.Kodi_4n2hpmxwrvr6p\LocalState\addons\plugin.video.putio\main.py", line 157, in play
                                                       li.setSubtitles(item.subtitles())
                                                     File "Q:\Users\UserMgr0\AppData\Local\Packages\XBMCFoundation.Kodi_4n2hpmxwrvr6p\LocalState\addons\plugin.video.putio\resources\lib\putio.py", line 189, in subtitles
                                                       assert subtitles_list_response.status_code == 200
                                                   AttributeError: 'dict' object has no attribute 'status_code'
                                                   -->End of Python script error report<--

2022-04-21 00:17:06.196 T:5424     INFO <general>: Python interpreter stopped
2022-04-21 00:17:06.225 T:4616    ERROR <general>: Playlist Player: skipping unplayable item: 0, path [plugin://plugin.video.putio/?action=play&item=746730408]

Seems like the response is empty or broken when attempting to fetch subtitles list:

https://github.com/putdotio/putio-kodi/blob/c3c0b967771d04a48456b31217fb33b037ab7b79/resources/lib/putio.py#L187-L189

Could you please take a look, @BatuAksoy?

berkanteber commented 1 month ago

I don't think this is still an issue with latest Kodi & add-on.

joelpurra commented 4 weeks ago

@berkanteber: this is still an issue in putio-kodi v3.1.0 on Kodi v20.5.0 ("latest" release available on Debian 12 on Raspberry Pi).

Looks like an API change? Fixed it locally last year, but forgot to issue a pull request.