Skip to content
This repository was archived by the owner on Feb 9, 2022. It is now read-only.

Fix Exception: 'NoneType' object has no attribute 'group'#1

Merged
JWolvers merged 1 commit into
JWolvers:masterfrom
ryao:nonetype-fix
Sep 10, 2018
Merged

Fix Exception: 'NoneType' object has no attribute 'group'#1
JWolvers merged 1 commit into
JWolvers:masterfrom
ryao:nonetype-fix

Conversation

@ryao
Copy link
Copy Markdown
Contributor

@ryao ryao commented Sep 10, 2018

Trying to watch Float Plane results in this error for me:

20:30:18.697 T:1498412016 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.AttributeError'>
Error Contents: 'NoneType' object has no attribute 'group'
Traceback (most recent call last):
File "/home/osmc/.kodi/addons/plugin.video.floatplaneclub/addon.py", line 94, in
plugin.run()
File "/home/osmc/.kodi/addons/script.module.xbmcswift2/lib/xbmcswift2/plugin.py", line 332, in run
items = self._dispatch(self.request.path)
File "/home/osmc/.kodi/addons/script.module.xbmcswift2/lib/xbmcswift2/plugin.py", line 306, in _dispatch
listitems = view_func(**items)
File "/home/osmc/.kodi/addons/plugin.video.floatplaneclub/addon.py", line 28, in show_page1
videos, has_next_page = scraper.get_videos()
File "/home/osmc/.kodi/addons/plugin.video.floatplaneclub/resources/lib/scraper.py", line 64, in get_videos
guid = re.search('https://cms.linustechtips.com/get/player/([a-zA-Z0-9]*)['|"]', item.text).group(1)
AttributeError: 'NoneType' object has no attribute 'group'
-->End of Python script error report<--

Changing the code to skip the item that causes the exception makes it
work for me.

Trying to watch Float Plane results in this error for me:

20:30:18.697 T:1498412016   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.AttributeError'>
                                            Error Contents: 'NoneType' object has no attribute 'group'
                                            Traceback (most recent call last):
                                              File "/home/osmc/.kodi/addons/plugin.video.floatplaneclub/addon.py", line 94, in <module>
                                                plugin.run()
                                              File "/home/osmc/.kodi/addons/script.module.xbmcswift2/lib/xbmcswift2/plugin.py", line 332, in run
                                                items = self._dispatch(self.request.path)
                                              File "/home/osmc/.kodi/addons/script.module.xbmcswift2/lib/xbmcswift2/plugin.py", line 306, in _dispatch
                                                listitems = view_func(**items)
                                              File "/home/osmc/.kodi/addons/plugin.video.floatplaneclub/addon.py", line 28, in show_page1
                                                videos, has_next_page = scraper.get_videos()
                                              File "/home/osmc/.kodi/addons/plugin.video.floatplaneclub/resources/lib/scraper.py", line 64, in get_videos
                                                guid = re.search('https:\/\/cms.linustechtips.com\/get\/player\/([a-zA-Z0-9]*)[\'|"]', item.text).group(1)
                                            AttributeError: 'NoneType' object has no attribute 'group'
                                            -->End of Python script error report<--

Changing the code to skip the item that causes the exception makes it
work for me.

Signed-off-by: Richard Yao <ryao@gentoo.org>
@JWolvers JWolvers merged commit 6bb7388 into JWolvers:master Sep 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants