bugatsinho / bugatsinho.github.io

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

[SportHD] Wrong air times on python3 #144

Closed pitsi closed 5 months ago

pitsi commented 5 months ago

As you can see in the screenshots below, I have set my timezone to the correct one (Greece, gmt+2) but the air times on the games stay on gmt. 10 minutes earlier, at 19:40 local time, all those links with the green star on the left had the red one, which means they have not aired yet.

This happens only on kodi 19 which is on python3, there is no issue on kodi 18 and python2 though. I have no kodi 20 installations handy so as to test it there.

screenshot00001

screenshot00002

bugatsinho commented 5 months ago

pitsi get an app in your mobile to get the actual times of the matches. timezone setting stopped work after the last website's changes. by default the addon shows the match time +2 hours.

pitsi commented 5 months ago

Are you serious about the mobile app? Why would I open another app, on another system, in order to something that is already there. Here are 2 new screenshots that show the issue better one from kodi 18 and one from kodi 19. As you can see, the one on kodi 19 shows the air times at gmt, not at gmt+2.

---edit Offtopic: please notice the &nbsp "characters" that show up on python2. It is another minor annoyance.

screenshot080

screenshot00001

bugatsinho commented 5 months ago

offtopic use new kodi versions! And yes i'm serious about the app or open a browser to get the events on your timezone simple as that! If you don't like the addon use another one.

pitsi commented 5 months ago

Will you fix it if I provide a screenshot of the same on kodi 20? A few months ago, I had explained on another issue why I have not moved to kodi 20 and why the libreelec development is to blame for the issues. Please respect that.

I do my best to keep my installations tidy, I post bug reports for an addon that I personally use once or twice a year (that applies to cartoonsgr too) and I do not use browsers or other apps on other systems so as get a "complete" experience from something that is already coded.

Also, there is no other sports addon that is actively maintained right now.

---edit You are right, it works as it should on kodi 20.

screenshot00000

bugatsinho commented 5 months ago

DONE https://github.com/bugatsinho/bugatsinho.github.io/commit/8fc9bfef3ed2ab399056c62846c6b9e5ac7b7534

pitsi commented 5 months ago

Thank you :)

pitsi commented 5 months ago

Version 0.1.45 is broken on python2 (kodi 18) because some non unicode character (ü) can not be parsed. I hoped it would be temporary, e.g. because it may be on some team's name, but it is not.

I post it here because it's python related. If you want, I can open a new issue.

2024-04-01 07:29:19.867 T:139698658182912   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.UnicodeEncodeError'>
                                            Error Contents: 'ascii' codec can't encode character u'\xfc' in position 6: ordinal not in range(128)
                                            Traceback (most recent call last):
                                              File "/storage/.kodi/addons/plugin.video.sporthdme/default.py", line 839, in <module>
                                                get_events(url)
                                              File "/storage/.kodi/addons/plugin.video.sporthdme/default.py", line 198, in get_events
                                                name = '{0} [COLORgold]{1}[/COLOR] - [I]{2}-{3}[/I]'.format( ftime, event, lname, country)
                                            UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 6: ordinal not in range(128)
                                            -->End of Python script error report<--
pitsi commented 5 months ago

On second thought, and 12+ hours later, it probably is a character from a team's name, because the error is tha same but this time it fails on ň

2024-04-01 20:44:57.909 T:140235539195648   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.UnicodeEncodeError'>
                                            Error Contents: 'ascii' codec can't encode character u'\u0148' in position 28: ordinal not in range(128)
                                            Traceback (most recent call last):
                                              File "/storage/.kodi/addons/plugin.video.sporthdme/default.py", line 839, in <module>
                                                get_events(url)
                                              File "/storage/.kodi/addons/plugin.video.sporthdme/default.py", line 198, in get_events
                                                name = '{0} [COLORgold]{1}[/COLOR] - [I]{2}-{3}[/I]'.format( ftime, event, lname, country)
                                            UnicodeEncodeError: 'ascii' codec can't encode character u'\u0148' in position 28: ordinal not in range(128)
                                            -->End of Python script error report<--
bugatsinho commented 5 months ago

Hi mate, i made an update in a harry cause many people having issues with the addon so i wasnt so much carefull with the code. I was working really hard to make it work again the last 2 days, cause website source code is a mess. Anyway, finally after many hours i think it's ok now and i will fix also those encoding issues. So wait for the next update. thank you

bugatsinho commented 5 months ago

If you want try this one plugin.video.sporthdme-0.1.47.zip

pitsi commented 5 months ago

This one crashes upon starting the addon.

2024-04-02 08:03:27.226 T:140527726970624   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 (default.py, line 254)
                                              File "/storage/.kodi/addons/plugin.video.sporthdme/default.py", line 254
                                                print(f"Error fetching data from API: {e}")
                                                                                         ^
                                            SyntaxError: invalid syntax
                                            -->End of Python script error report<--

Small request: can you please add a space in all color instances, like COLORgold to become COLOR gold?

pitsi commented 5 months ago

I just noticed that v0.1.47 reached the repo. The addon still fails to even launch and this comes in the log (different output than above). Can you please reopen this or move it to a new issue?

2024-04-03 11:34:59.266 T:139947032102656   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.TypeError'>
                                            Error Contents: makedirs() got an unexpected keyword argument 'exist_ok'
                                            Traceback (most recent call last):
                                              File "/storage/.kodi/addons/plugin.video.sporthdme/default.py", line 190, in <module>
                                                os.makedirs(os.path.dirname(JSON_FILE_PATH), exist_ok=True)
                                            TypeError: makedirs() got an unexpected keyword argument 'exist_ok'
                                            -->End of Python script error report<--

---edit And this is what happens on kodi 19

2024-04-03 11:50:20.212 T:701     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: 'NoneType' object is not callable
                                                   Traceback (most recent call last):
                                                     File "/storage/.kodi/addons/plugin.video.sporthdme/default.py", line 303, in get_events
                                                       ftime = time_convert(match['timestampInMs'])
                                                     File "/storage/.kodi/addons/plugin.video.sporthdme/default.py", line 72, in time_convert
                                                       timestamp = int(str(timestamp)[:10])
                                                   ValueError: invalid literal for int() with base 10: 'None'

                                                   During handling of the above exception, another exception occurred:

                                                   Traceback (most recent call last):
                                                     File "/storage/.kodi/addons/plugin.video.sporthdme/default.py", line 978, in <module>
                                                       get_events(url)
                                                     File "/storage/.kodi/addons/plugin.video.sporthdme/default.py", line 307, in get_events
                                                       ftime = time_convert(matchdate_to_timestamp_ms(matchdate))
                                                     File "/storage/.kodi/addons/plugin.video.sporthdme/default.py", line 179, in matchdate_to_timestamp_ms
                                                       date_obj = datetime.strptime(matchdate, matchdate_format)
                                                   TypeError: 'NoneType' object is not callable
                                                   -->End of Python script error report<--
bugatsinho commented 5 months ago

This is the end mate! Better enter my telegram group cause I don't have time to write same replies all over.

bugatsinho commented 5 months ago

There is already a 0.1.48 version and probably a new one coming out soon. Website is a mess mate thats all I have to say. I lost 3 days of my life to come across a solution. so relax and enjoy as far it works!

pitsi commented 5 months ago

No need to apologise, I see that the site is a pita to scrap.

So, the addon does not work on kodi 18 on both 48 and 49. This is the error it shows for 49. I deleted the folder there, which althought it was empty, it is actually the addon's settings, but nothing changed.

2024-04-04 08:39:19.161 T:140341310056192   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.OSError'>
                                            Error Contents: [Errno 17] File exists: '/storage/.kodi/userdata/addon_data/plugin.video.sporthdme'
                                            Traceback (most recent call last):
                                              File "/storage/.kodi/addons/plugin.video.sporthdme/default.py", line 221, in <module>
                                                os.makedirs(os.path.dirname(JSON_FILE_PATH))
                                              File "/usr/lib/python2.7/os.py", line 157, in makedirs
                                            OSError: [Errno 17] File exists: '/storage/.kodi/userdata/addon_data/plugin.video.sporthdme'
                                            -->End of Python script error report<--

I did check 48 last night, on both kodi 18 and 19, and it worked only on 19. I did not keep the error log from it though, because I was too tired last night to post it.

Arthur1967 commented 5 months ago

I’ve just been following this to me. The easy solution would be to update to 19.1 if the person wants this to work, wouldn’t it be?

On Thu, Apr 4, 2024 at 1:52 AM pitsi @.***> wrote:

No need to apologise, I see that the site is a pita to scrap.

So, the addon does not work on kodi 18 on both 48 and 49. This is the error it shows for 49. I deleted the folder there, which althought it was empty, it is actually the addon's settings, but nothing changed.

2024-04-04 08:39:19.161 T:140341310056192 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--

  • NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS! Error Type: <type 'exceptions.OSError'> Error Contents: [Errno 17] File exists: '/storage/.kodi/userdata/addon_data/plugin.video.sporthdme' Traceback (most recent call last): File "/storage/.kodi/addons/plugin.video.sporthdme/default.py", line 221, in os.makedirs(os.path.dirname(JSON_FILE_PATH)) File "/usr/lib/python2.7/os.py", line 157, in makedirs OSError: [Errno 17] File exists: '/storage/.kodi/userdata/addon_data/plugin.video.sporthdme' -->End of Python script error report<--

I did check 48 last night, on both kodi 18 and 19, and it worked only on

  1. I did not keep the error log from it though, because I was too tired last night to post it.

— Reply to this email directly, view it on GitHub https://github.com/bugatsinho/bugatsinho.github.io/issues/144#issuecomment-2036242834, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQWA4AHGBB5PRZEBMIHL7JDY3TTDPAVCNFSM6AAAAABEX33I2OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMZWGI2DEOBTGQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

pitsi commented 5 months ago

Please take a minute to read why I am still on kodi 18, here https://github.com/bugatsinho/bugatsinho.github.io/issues/127#issuecomment-1658195580

bugatsinho commented 5 months ago

No need to apologise, I see that the site is a pita to scrap.

So, the addon does not work on kodi 18 on both 48 and 49. This is the error it shows for 49. I deleted the folder there, which althought it was empty, it is actually the addon's settings, but nothing changed.

2024-04-04 08:39:19.161 T:140341310056192   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.OSError'>
                                            Error Contents: [Errno 17] File exists: '/storage/.kodi/userdata/addon_data/plugin.video.sporthdme'
                                            Traceback (most recent call last):
                                              File "/storage/.kodi/addons/plugin.video.sporthdme/default.py", line 221, in <module>
                                                os.makedirs(os.path.dirname(JSON_FILE_PATH))
                                              File "/usr/lib/python2.7/os.py", line 157, in makedirs
                                            OSError: [Errno 17] File exists: '/storage/.kodi/userdata/addon_data/plugin.video.sporthdme'
                                            -->End of Python script error report<--

I did check 48 last night, on both kodi 18 and 19, and it worked only on 19. I did not keep the error log from it though, because I was too tired last night to post it.

Ok mate I will check the error and fix it ASAP. It was empty cause a json and txt file wasn't created.

bugatsinho commented 5 months ago

with the new update https://github.com/bugatsinho/bugatsinho.github.io/commit/1dd2898b46511f11897d3036112828cca32c4c76 I think should work, as I tested in kodi18 & kodi21

pitsi commented 5 months ago

I still get an error about some character that broke it. And now I am almost 100% sure that the teams' names break it.

2024-04-05 08:30:29.633 T:140662831789824   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.UnicodeEncodeError'>
                                            Error Contents: 'ascii' codec can't encode character u'\u017e' in position 25: ordinal not in range(128)
                                            Traceback (most recent call last):
                                              File "/storage/.kodi/addons/plugin.video.sporthdme/default.py", line 981, in <module>
                                                get_events(url)
                                              File "/storage/.kodi/addons/plugin.video.sporthdme/default.py", line 367, in get_events
                                                name = '{0} [COLOR {1}]{2}[/COLOR] - [I]{3}-{4}[/I]'.format( ftime, m_color, event, lname, country)
                                            UnicodeEncodeError: 'ascii' codec can't encode character u'\u017e' in position 25: ordinal not in range(128)
                                            -->End of Python script error report<--

Although I do not know exactly how sporthd works, if you need help, I can post a way (function) another addon uses in order to mitigate these utf8 issues of python2. I don't know what needs to be re-written on the addon in order to use it.

And a reason for the request I made above for the colors. This is how the line that starts with name shows up in kodi's log viewer. Notice how {2} looks there. It has turned grey, because some color parameter broke/messed the output. When I first asked about it, it was the gold color parameter that colored the text next, so it showed up "in color" in the log viewer, like warnings and errors do, Because they have to be eyecatching :D

screenshot087

p.s. I will be afk from Friday afternoon to Sunday afternoon, so if something changes, I may be able to check it but not report it.

bugatsinho commented 5 months ago

The best solution is to stop supporting old versions! Then you will find your solution😉

pitsi commented 5 months ago

I will, if you promise to raise the minimum xbmc.python version in addon.xml to 3.0.0 (kodi 19+) or even 3.0.1 (kodi 20+) and remove 18.x from the line that says "compatible with". And that applies to any addon you do not want to waste your time making it backwards compatible with python2. Many devs have done that and I respect it.

Keep in mind thought that you will lose any proper bug reports, with logs etc, which I open on a timely manner. I am not the user who e.g. opens a report saying "Omg sporthd does not work, what do I do?" and then posts a like on his comment, because obviously a like draws the dev's attention to it :D
And right now, I am about to open a new one for cartoonsgr, which is partially broken, regardless of python version. I discovered it yesterday, on kodi 20.

---edit Small tldr to let you understand how I report issues for sporthd, because I rarely watch sports and use it. A friend of mine has sporthd installed on his android tv (kodi 20 as of today), which is a pita to get a log from, and when an issue occurs, he contacts me and IF i can reproduce it on kodi 18 or 19 (2 libreelec x64 installations), I file an issue.