bugatsinho/bugatsinho.github.io

Both domains fail to launch on kodi 19

Closed this issue · 16 comments

pitsi commented

Now that cartoonsgr supports and starts on kodi 19, I decided to use it. And it fails to launch for both domains listed at its main screen. When pressing the festive entry, this comes up in the log

2021-11-02 13:27:00.957 T:3666    ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'AttributeError'>
                                                   Error Contents: 'HTMLParser' object has no attribute 'unescape'
                                                   Traceback (most recent call last):
                                                     File "/home/user/.kodi/addons/plugin.video.cartoonsgr/default.py", line 1082, in <module>
                                                       teniesonline.metaglotismeno(url)
                                                     File "/home/user/.kodi/addons/plugin.video.cartoonsgr/resources/lib/indexers/teniesonline.py", line 49, in metaglotismeno
                                                       desc = client.replaceHTMLCodes(plot)
                                                     File "/home/user/.kodi/addons/plugin.video.cartoonsgr/resources/lib/modules/client.py", line 417, in replaceHTMLCodes
                                                       txt = HTMLParser.HTMLParser().unescape(txt)
                                                   AttributeError: 'HTMLParser' object has no attribute 'unescape'
                                                   -->End of Python script error report<--
                                                   
2021-11-02 13:27:01.018 T:3666     INFO <general>: Python interpreter stopped

and when pressing any of the three entries under the gamato movies one, whis comes up

2021-11-02 13:29:57.768 T:3715    ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'AttributeError'>
                                                   Error Contents: 'HTMLParser' object has no attribute 'unescape'
                                                   Traceback (most recent call last):
                                                     File "/home/user/.kodi/addons/plugin.video.cartoonsgr/default.py", line 1049, in <module>
                                                       gamato_kids(url)
                                                     File "/home/user/.kodi/addons/plugin.video.cartoonsgr/default.py", line 611, in gamato_kids
                                                       desc = client.replaceHTMLCodes(plot)
                                                     File "/home/user/.kodi/addons/plugin.video.cartoonsgr/resources/lib/modules/client.py", line 417, in replaceHTMLCodes
                                                       txt = HTMLParser.HTMLParser().unescape(txt)
                                                   AttributeError: 'HTMLParser' object has no attribute 'unescape'
                                                   -->End of Python script error report<--
                                                   
2021-11-02 13:29:57.822 T:3715     INFO <general>: Python interpreter stopped

It is practically the same error though, but in different parts of the addon.

Kodi 19.3 on linux x64, cartoonsgr 1.0.25 and english locale for kodi and the system too.
Everything works fine on kodi 18.9 on libreelec 9.2.6 x64.

Possibly a fix 8a1e12d

pitsi commented

It did not work. Log output for the festive one

2021-11-03 08:45:27.002 T:13528   ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'AttributeError'>
                                                   Error Contents: 'HTMLParser' object has no attribute 'unescape'
                                                   Traceback (most recent call last):
                                                     File "/home/user/.kodi/addons/plugin.video.cartoonsgr/default.py", line 1082, in <module>
                                                       teniesonline.metaglotismeno(url)
                                                     File "/home/user/.kodi/addons/plugin.video.cartoonsgr/resources/lib/indexers/teniesonline.py", line 49, in metaglotismeno
                                                       desc = client.replaceHTMLCodes(plot)
                                                     File "/home/user/.kodi/addons/plugin.video.cartoonsgr/resources/lib/modules/client.py", line 422, in replaceHTMLCodes
                                                       txt = HTMLParser.HTMLParser().unescape(txt)
                                                   AttributeError: 'HTMLParser' object has no attribute 'unescape'
                                                   -->End of Python script error report<--

and for the ones under gamato movies

2021-11-03 08:45:46.930 T:13547   ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'AttributeError'>
                                                   Error Contents: 'HTMLParser' object has no attribute 'unescape'
                                                   Traceback (most recent call last):
                                                     File "/home/user/.kodi/addons/plugin.video.cartoonsgr/default.py", line 1049, in <module>
                                                       gamato_kids(url)
                                                     File "/home/user/.kodi/addons/plugin.video.cartoonsgr/default.py", line 611, in gamato_kids
                                                       desc = client.replaceHTMLCodes(plot)
                                                     File "/home/user/.kodi/addons/plugin.video.cartoonsgr/resources/lib/modules/client.py", line 422, in replaceHTMLCodes
                                                       txt = HTMLParser.HTMLParser().unescape(txt)
                                                   AttributeError: 'HTMLParser' object has no attribute 'unescape'
                                                   -->End of Python script error report<--

Proof that client.py is patched from line 417 to 421 as in your commit. I actually deleted the original file and downloaded yours.

$ sed '417,421!d' .kodi/addons/plugin.video.cartoonsgr/resources/lib/modules/client.py 
    if six.PY3:
        import html
        txt = html.unescape(txt)
    else:
        txt = HTMLParser.HTMLParser().unescape(txt)

I forgot deleting line 422 in previous commit. Try this one
39d89b4

pitsi commented

Almost! Now the festive one does not launch only and pops this error

2021-11-03 14:06:22.775 T:5206    ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'TypeError'>
                                                   Error Contents: cannot use a string pattern on a bytes-like object
                                                   Traceback (most recent call last):
                                                     File "/home/user/.kodi/addons/plugin.video.cartoonsgr/default.py", line 1082, in <module>
                                                       teniesonline.metaglotismeno(url)
                                                     File "/home/user/.kodi/addons/plugin.video.cartoonsgr/resources/lib/indexers/teniesonline.py", line 61, in metaglotismeno
                                                       title = clear_Title(title)
                                                     File "/home/user/.kodi/addons/plugin.video.cartoonsgr/resources/lib/indexers/teniesonline.py", line 178, in clear_Title
                                                       txt = re.sub('<.+?>', '', txt)
                                                     File "/usr/lib/python3.9/re.py", line 210, in sub
                                                       return _compile(pattern, flags).sub(repl, string, count)
                                                   TypeError: cannot use a string pattern on a bytes-like object
                                                   -->End of Python script error report<--

The other one does work though.

One more thing I noticed on kodi 19 is that there are no posters for the videos. Again, posters show up fine on kodi 18.

Festive category comes from tenies-online, which's scraper hasn't been converted to be py3 compliant, there are many adjustments to be made for it.
I've got it working, but doesn't really worth it, most of their links are dead.

pitsi commented

Feel free to remove it then.

---edit
Does it have ONLY festive content? I always had that question :P

There used to be a section for that site, with a couple of (kids related) categories in it.
I think @bugatsinho removed it because the site implemented some anti-bot measures we couldn't bypass. This is no longer the case, but maybe it's triggered over certain traffic.
Code's still there (commented out), I've made it py3 compliant, so if @bugatsinho wants it back in I can pr.

Feel free to remove it then.

Thanks for the freedom, but what goes in/out of the add-on is subject to it's author.

sorry guys but i was really busy lately. No much time for Kodi stuff. i've checked the PR @kolekan and merged it. Also @kolekan @host505 feel free to share any other website with kids content or you can code it ;)

CartoonsGR updated to 1.0.26

  • Kodi 19.x compatibility
  • fix gamato link regex
  • fix gamato trailer link regex
    commit

There used to be a section for that site, with a couple of (kids related) categories in it. I think @bugatsinho removed it because the site implemented some anti-bot measures we couldn't bypass. >

i still getting anti-bot protection but because of my location. if i use Greek IP with VPN then i can access directly the website. So if you want to make a PR you are more than welcome mate @host505

ok
#90

pitsi commented

Can I close this? I just realised there is an update.
The festive category still does not work though.

pitsi commented

No, because it not in the repo, so it can not be installed fresh on a new installation and, obviously, an existing installation) would not upgrade to it but to 1.0.26.
Is it kodi 18 and 19 compatible?

pitsi commented

So I just installed it on kodi 18. There are 3 issues that are visible after a couple of seconds of usage and probably both are related to the new domain (tainies-online) itself.
ALL subcategories under there have the same content, there are almost no playable sources and there is only one page of results!

This zip has the changes I pr'ed, pull request is linked above. Please whatever issues you have with it post them on the pull request.