bugatsinho / bugatsinho.github.io

Bugatsinho New Repository
GNU General Public License v3.0
77 stars 41 forks source link

Cartoonsgr fails to launch #78

Closed pitsi closed 3 years ago

pitsi commented 3 years ago

I just noticed that cartoonsgr fails to launch and shows these in the log

2021-07-22 10:36:22.706 T:140322592737024   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.KeyError'>
                                            Error Contents: u'\u0393'
                                            Traceback (most recent call last):
                                              File "/storage/.kodi/addons/plugin.video.cartoonsgr/default.py", line 960, in <module>
                                                Main_addDir()
                                              File "/storage/.kodi/addons/plugin.video.cartoonsgr/default.py", line 47, in Main_addDir
                                                ART + 'mas.jpg', FANART, '')
                                              File "/storage/.kodi/addons/plugin.video.cartoonsgr/resources/lib/modules/control.py", line 367, in addDir
                                                "&iconimage="+urllib.quote_plus(iconimage)+"&description="+urllib.quote_plus(description)
                                              File "/usr/lib/python2.7/urllib.py", line 1303, in quote_plus
                                              File "/usr/lib/python2.7/urllib.py", line 1298, in quote
                                            KeyError: u'\u0393'
                                            -->End of Python script error report<--
2021-07-22 10:36:22.820 T:140322668300032   ERROR: GetDirectory - Error getting plugin://plugin.video.cartoonsgr/
2021-07-22 10:36:22.827 T:140324056209536   ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.cartoonsgr/) failed

Tested on libreelec x64 9.2.6 and coreelec 9.2.7, both with kodi 18.9. I also tried deleting any settings and installing fresh.

bugatsinho commented 3 years ago

it works ok in my end. if your set up is new try to install SportHD add-on from my repository and check if issue solved. thank you!

pitsi commented 3 years ago

Are you sure? I already had sporthd installed on those 2 devices, but cartoonsgr does not seem to be affected by it. I also tried it on 2 more (rpi3b+ with libreelec 9.2.7, tvbox with libreelec 9.2.8), with and without sporthd, and the results are the same. Now I am waiting for a friend to test it on her windows 10 installation. All of them run kodi 18.9. I wish I could test it on my kodi 19.1 that runs on my pc, but cartoonsgr is not compatible with python3.

If it helps, I have google's dns everywhere on my network and, in my browser, I can open the 2 pages it uses just fine. What if something is region blocked? In that case, I am in Greece and otenet is my isp.

pitsi commented 3 years ago

Is there any way I can help debugging this a bit? All I can understand from the error above is that the KeyError: u'\u0393' part refers to the greek letter "Γ", which possibly has to do with "gamato"...

pitsi commented 3 years ago

Same thing happens on a friends' kodi install that runs in arch linux. What os do you run your kodi on? I am asking because all the forementioned kodi installations are under linux.

host505 commented 3 years ago

@bugatsinho problem exists on installs running kodi in Greek. Found an easy fix for this, on control.py add from six import ensure_str and on addDir func name = ensure_str(name, errors='ignore')

edit: also tenies-online domain has changed to https://tenies-online1.gr/

pitsi commented 3 years ago

How can I patch this myself? I know I can add from six import ensure_str after line 26, but what about the other one?

host505 commented 3 years ago

The other one under this: https://github.com/bugatsinho/bugatsinho.github.io/blob/master/plugin.video.cartoonsgr/resources/lib/modules/control.py#L358 Should be line 359 now. Make sure to also add 4 spaces before the code.

bugatsinho commented 3 years ago

@bugatsinho problem exists on installs running kodi in Greek. Found an easy fix for this, on control.py add from six import ensure_str and on addDir func name = ensure_str(name, errors='ignore')

edit: also tenies-online domain has changed to https://tenies-online1.gr/

thanks mate! i did all my checks on Kodi19 and didnt get any errors. I will fix it now and update it. About the spaces though i'm using tabs 😎

bugatsinho commented 3 years ago

Also i removed from menu tenies-online because of that image

host505 commented 3 years ago

About the spaces though i'm using tabs 😎

Maybe your editor/ide converts them to spaces, cause I see spaces in code?

host505 commented 3 years ago

I also have another suggestion, it's about the saved searches. You're using the saved search url from db, but because the domains change that url might be dead. So I suggest to construct the search url based on current domains (read from settings) and the saved search terms. I did it like this, replaced these lines: https://github.com/bugatsinho/bugatsinho.github.io/blob/master/plugin.video.cartoonsgr/default.py#L371-L377 with this:

    for (url, search) in dbcur.fetchall():
        search = six.ensure_str(search, errors='replace')
        if 'gamato' in url:
            _url = GAMATO + "?s={}".format(quote_plus(search))
            domain = 'GAMATOKIDS'
        else:
            _url = Teniesonline + "?s={}".format(quote_plus(search))
            domain = 'TENIES-ONLINE'
        title = '[B]%s[/B] - [COLORgold][B]%s[/COLOR][/B]' % (search, domain)
        delete_option = True
        addDir(title, _url, 26, ICON, FANART, '')
        lst += [(search)]

I'd make a pr, but you said you'll remove tenies-online so I'll hold.

bugatsinho commented 3 years ago

CartoonsGR updated to 1.0.21. Thank you all

host505 commented 3 years ago

Hey mate, with your last commit 1105778f82a93ee918ddeb44930900f86b2b12c7 you reverted some things from the previous commit, like the saved searches fix. At least on the source code, haven't checked the .zip yet.

Also wanted to ask, are you still working on a Kodi 19 compatible version? Thinking about giving it a try, but not if you're working on it.

pitsi commented 2 years ago

I noticed earlier that cartoonsgr is now kodi 19 compatible, so I installed it. And it just fails to launch with this error in the log

2021-10-24 14:28:04.181 T:694     ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'ModuleNotFoundError'>
                                                   Error Contents: No module named 'cookielib'
                                                   Traceback (most recent call last):
                                                     File "/storage/.kodi/addons/plugin.video.cartoonsgr/default.py", line 20, in <module>
                                                       from resources.lib.modules import client
                                                     File "/storage/.kodi/addons/plugin.video.cartoonsgr/resources/lib/modules/client.py", line 22, in <module>
                                                       import re, sys, cookielib, time, random
                                                   ModuleNotFoundError: No module named 'cookielib'
                                                   -->End of Python script error report<--

2021-10-24 14:28:04.380 T:694      INFO <general>: Python interpreter stopped
2021-10-24 14:28:04.397 T:693     ERROR <general>: GetDirectory - Error getting plugin://plugin.video.cartoonsgr/
2021-10-24 14:28:04.418 T:605     ERROR <general>: CGUIMediaWindow::GetDirectory(plugin://plugin.video.cartoonsgr/) failed

It is not related to kodi's locale like last time though. The above is from kodi 19.1 on libreelec 10, but the same is observed on kodi 19.2 (under linux) too.

bugatsinho commented 2 years ago

I noticed earlier that cartoonsgr is now kodi 19 compatible, so I installed it. And it just fails to launch with this error in the log

2021-10-24 14:28:04.181 T:694     ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'ModuleNotFoundError'>
                                                   Error Contents: No module named 'cookielib'
                                                   Traceback (most recent call last):
                                                     File "/storage/.kodi/addons/plugin.video.cartoonsgr/default.py", line 20, in <module>
                                                       from resources.lib.modules import client
                                                     File "/storage/.kodi/addons/plugin.video.cartoonsgr/resources/lib/modules/client.py", line 22, in <module>
                                                       import re, sys, cookielib, time, random
                                                   ModuleNotFoundError: No module named 'cookielib'
                                                   -->End of Python script error report<--

2021-10-24 14:28:04.380 T:694      INFO <general>: Python interpreter stopped
2021-10-24 14:28:04.397 T:693     ERROR <general>: GetDirectory - Error getting plugin://plugin.video.cartoonsgr/
2021-10-24 14:28:04.418 T:605     ERROR <general>: CGUIMediaWindow::GetDirectory(plugin://plugin.video.cartoonsgr/) failed

It is not related to kodi's locale like last time though. The above is from kodi 19.1 on libreelec 10, but the same is observed on kodi 19.2 (under linux) too.

i will check it right now.

pitsi commented 2 years ago

The addon does launch after the upgrade to 1.0.25 (sorry I missed 1.0.24 but I was afk when it was released), but none of the 2 sites from the main menu work on kodi 19. They do work on kodi 18 though. I will post a new issue later today.