mbebe/blomqvist

[TVseries.video] Not starting on kodi 18 after the upgrade to v0.4

pitsi opened this issue · 1 comments

As mentioned in the title, the addon fails to start on kodi 18 with this parsing error that is probably related to python2's shortcomings. It works fine on kodi 19 and newer and, unfortunately, I have no idea how to patch it.

2024-02-24 08:51:51.792 T:140645828364032   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.SyntaxError'>
                                            Error Contents: invalid syntax (main.py, line 631)
                                              File "/storage/.kodi/addons/plugin.video.tvseriesvideo/main.py", line 631
                                                file2= re.sub(rf'{"|".join(xx)}', '', file2)
                                                                               ^
                                            SyntaxError: invalid syntax
                                            -->End of Python script error report<--

And as I have said in the past, I have no problem if it becomes a python3-only addon, provided that it is stated like so by xbmc.python in its addon.xml.

Thank you in advance.

A friend who knows more about python told me to change line 631 to this

# sed -n 631p .kodi/addons/plugin.video.tvseriesvideo/main.py
                                file2= re.sub(pattern,'', file2)

and now the addon works again!