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

IndexError at video_file_size = column2[4] #26

Open
uowiec opened this issue Feb 17, 2021 · 3 comments
Open

IndexError at video_file_size = column2[4] #26

uowiec opened this issue Feb 17, 2021 · 3 comments

Comments

@uowiec
Copy link

uowiec commented Feb 17, 2021

When searching for any movie subtitles I get:

                                            Error Type: <type 'exceptions.IndexError'>
                                            Error Contents: list index out of range
                                            Traceback (most recent call last):
                                              File "/home/kodi/.kodi/addons/service.subtitles.napisy24pl/service.py", line 152, in <module>
                                                search(item)
                                              File "/home/kodi/.kodi/addons/service.subtitles.napisy24pl/service.py", line 33, in search
                                                subtitles_list = helper.get_subtitle_list(item)
                                              File "/home/kodi/.kodi/addons/service.subtitles.napisy24pl/resources/lib/NapisyUtils.py", line 106, in get_subtitle_list
                                                search_results = self._search_movie(item)
                                              File "/home/kodi/.kodi/addons/service.subtitles.napisy24pl/resources/lib/NapisyUtils.py", line 208, in _search_movie
                                                video_file_size = column2[4]
                                            IndexError: list index out of range
                                            -->End of Python script error report<--

This is probably caused because the BS returns <br/> (the xhtml style closing tag) istead of the <br> as originally returned from server in line:
column2 = "".join([str(x) for x in column2.contents])
Possible solution would be:
205: column2 = [x.strip() for x in filter(None, column2.split("<br/>"))]
or configure BS to force single tags closing style (fix the content to either <br> or <br/>)

@CaTzil
Copy link
Owner

CaTzil commented Feb 20, 2021

Thank you for reporting this issue, I've tested on latest Kodi (19 final)

Looks like there some issue with the zip extraction method, it doesn't work for movies nor tv-shows

@CaTzil
Copy link
Owner

CaTzil commented Feb 20, 2021

@uowiec what version of kodi & plugin do you use?

@uowiec
Copy link
Author

uowiec commented Feb 23, 2021

@uowiec what version of kodi & plugin do you use?

Kodi on Ubuntu: 2:18.9+git20201024.0821-final-0bionic
plugin: service.subtitles.napisy24pl v2.0.3
plugin: script.module.beautifulsoup4 v4.6.2

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

No branches or pull requests

2 participants