jarmo / service.subtitles.subscene

service.subtitles.subscene
GNU General Public License v2.0
13 stars 6 forks source link

TV-Shows are not working on Kodi 19/Python 3 #2

Closed jarmo closed 4 years ago

jarmo commented 4 years ago

According to https://forum.kodi.tv/showthread.php?tid=184854&pid=2915699#pid2915699 there is a problem running this plugin on Kodi 19/Python 3. Here's the relevant stacktrace:

Error Type: <class 'NameError'>
Error Contents: name 'HTMLParser' is not defined
Traceback (most recent call last):
  File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/service.subtitles.subscene/service.py", line 605, in <module>
    search(item)
  File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/service.subtitles.subscene/service.py", line 385, in search
    search_tvshow(item['tvshow'], item['season'], item['episode'], item['3let_language'], filename)
  File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/service.subtitles.subscene/service.py", line 345, in search_tvshow
    tv_show_seasonurl = find_tv_show_season(content, tvshow, seasons[int(season)])
  File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/service.subtitles.subscene/service.py", line 155, in find_tv_show_season
    h = HTMLParser.HTMLParser()
NameError: name 'HTMLParser' is not defined

Offending line is this: https://github.com/jarmo/service.subtitles.subscene/blob/master/service.py#L155

It seems that this logic should be similar to: https://github.com/jarmo/service.subtitles.subscene/blob/master/service.py#L89-L92

jarmo commented 4 years ago

Since find_tv_show_season is not tried out before then I would not just make these 3 lines change, but I would actually try this functionality out to be sure that everything else in that function works with Python 3.

PS! Extract these 3 lines into a html_parser method or something since it's going to be already at three different places.

AnonTester commented 4 years ago

I didn't test tvshows before and missed the parser call. As all are the same, I reverted the conditional call and loaded the html.parser as HTMLParser instead.

jarmo commented 4 years ago

Fixed in 1.8.2.