Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed TypeError that crashes the addon #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

1337Boby
Copy link

The latest Version of the Addon crashes every time you try to get any videodata. This change prevents the addon from crashing.
I guess the 4Players api changed and returns other types.

Kodi.log callstack for further information:
"
ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.TypeError'>
Error Contents: unsupported operand type(s) for /: 'unicode' and 'int'
Traceback (most recent call last):
File "C:\Users...\AppData\Roaming\Kodi\addons\plugin.video.4players\addon.py", line 210, in
plugin.run()
File "C:\Users...\AppData\Roaming\Kodi\addons\script.module.xbmcswift2\lib\xbmcswift2\plugin.py", line 332, in run
items = self._dispatch(self.request.path)
File "C:\Users...\AppData\Roaming\Kodi\addons\script.module.xbmcswift2\lib\xbmcswift2\plugin.py", line 306, in _dispatch
listitems = view_func(**items)
File "C:\Users...\AppData\Roaming\Kodi\addons\plugin.video.4players\addon.py", line 65, in latest_videos
items = __format_videos(videos)
File "C:\Users...\AppData\Roaming\Kodi\addons\plugin.video.4players\addon.py", line 166, in __format_videos
} for i, video in enumerate(videos)]
TypeError: unsupported operand type(s) for /: 'unicode' and 'int'
-->End of Python script error report<--
"

The latest Version of the Addon crashes every time you try to get any videodata. This change prevents the addon from crashing.
I guess the 4Players api changed and returns other types.

Kodi.log callstack for further information:
"
ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.TypeError'>
                                            Error Contents: unsupported operand type(s) for /: 'unicode' and 'int'
                                            Traceback (most recent call last):
                                              File "C:\Users\...\AppData\Roaming\Kodi\addons\plugin.video.4players\addon.py", line 210, in <module>
                                                plugin.run()
                                              File "C:\Users\...\AppData\Roaming\Kodi\addons\script.module.xbmcswift2\lib\xbmcswift2\plugin.py", line 332, in run
                                                items = self._dispatch(self.request.path)
                                              File "C:\Users\...\AppData\Roaming\Kodi\addons\script.module.xbmcswift2\lib\xbmcswift2\plugin.py", line 306, in _dispatch
                                                listitems = view_func(**items)
                                              File "C:\Users\...\AppData\Roaming\Kodi\addons\plugin.video.4players\addon.py", line 65, in latest_videos
                                                items = __format_videos(videos)
                                              File "C:\Users\...\AppData\Roaming\Kodi\addons\plugin.video.4players\addon.py", line 166, in __format_videos
                                                } for i, video in enumerate(videos)]
                                            TypeError: unsupported operand type(s) for /: 'unicode' and 'int'
                                            -->End of Python script error report<--
"
@da-anda
Copy link

da-anda commented Dec 22, 2016

ping @dersphere do you have a spare minute to merge this fix and bump the add-on in the repo? Tested the PR and it's fixing the issue. Thanks.

@da-anda
Copy link

da-anda commented Jan 18, 2017

I PRed the fix to the Kodi repo xbmc/repo-plugins#872

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants