Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to browse on OSMC #29

Open
hakuya opened this issue Apr 17, 2020 · 1 comment
Open

Unable to browse on OSMC #29

hakuya opened this issue Apr 17, 2020 · 1 comment

Comments

@hakuya
Copy link

hakuya commented Apr 17, 2020

I don't seem to be able to browse any of the top-level categories, having installed this plugin on OSMC on a RPi3. I haven't tried other platforms to confirm whether they are affected.

The ultimate underlying issue appears to be an HTTP 406 error returned by the API, although the script is not taking it well,

2020-04-17 14:09:26.273 T:1447015136   DEBUG: [plugin.video.f1tv] urllib3.connectionpool: https://api.formula1.com:443 "POST /v1/account/Subscriber/CreateSession HTTP/1.1" 200 None
2020-04-17 14:09:26.294 T:1447015136   DEBUG: [plugin.video.f1tv] urllib3.connectionpool: Starting new HTTPS connection (1): f1tv.formula1.com:443
2020-04-17 14:09:27.036 T:1447015136   DEBUG: [plugin.video.f1tv] urllib3.connectionpool: https://f1tv.formula1.com:443 "POST /api/social-authenticate/ HTTP/1.1" 201 2281
2020-04-17 14:09:53.681 T:1472193248   DEBUG: Thread JobWorker 1472193248 terminating (autodelete)
2020-04-17 14:09:53.681 T:1430229728   DEBUG: Thread JobWorker 1430229728 terminating (autodelete)
2020-04-17 14:09:56.946 T:1447015136   DEBUG: [plugin.video.f1tv] urllib3.connectionpool: https://f1tv.formula1.com:443 "GET /api/sets/?slug=home HTTP/1.1" 406 139
2020-04-17 14:09:56.956 T:1447015136   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.UnboundLocalError'>
                                            Error Contents: local variable 'rj' referenced before assignment
                                            Traceback (most recent call last):
                                              File "/home/osmc/.kodi/addons/plugin.video.f1tv/main.py", line 14, in <module>
                                                plugin.run()
                                              File "/home/osmc/.kodi/addons/plugin.video.f1tv/resources/lib/plugin.py", line 589, in run
                                                router(sys.argv[2][1:])
                                              File "/home/osmc/.kodi/addons/plugin.video.f1tv/resources/lib/plugin.py", line 537, in router
                                                sets()
                                              File "/home/osmc/.kodi/addons/plugin.video.f1tv/resources/lib/plugin.py", line 94, in sets
                                                sets = _api_manager.getSets()
                                              File "/home/osmc/.kodi/addons/plugin.video.f1tv/resources/lib/F1TVParser/F1TV_Minimal_API.py", line 130, in getSets
                                                for item in rj['objects'][0]['items']:
                                            UnboundLocalError: local variable 'rj' referenced before assignment
                                            -->End of Python script error report<--

I can see in the code that if json is not okay, rj is not created. So some error handling should be cleaned up there.

"By circuit" seems to be coding bug,

                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.NameError'>
                                            Error Contents: global name '__OLD_TV_API__TV_API__' is not defined
                                            Traceback (most recent call last):
                                              File "/home/osmc/.kodi/addons/plugin.video.f1tv/main.py", line 14, in <module>
                                                plugin.run()
                                              File "/home/osmc/.kodi/addons/plugin.video.f1tv/resources/lib/plugin.py", line 589, in run
                                                router(sys.argv[2][1:])
                                              File "/home/osmc/.kodi/addons/plugin.video.f1tv/resources/lib/plugin.py", line 535, in router
                                                list_circuits()
                                              File "/home/osmc/.kodi/addons/plugin.video.f1tv/resources/lib/plugin.py", line 204, in list_circuits
                                                circuits = _api_manager.getCircuits()['objects']
                                              File "/home/osmc/.kodi/addons/plugin.video.f1tv/resources/lib/F1TVParser/F1TV_Minimal_API.py", line 92, in getCircuits
                                                complete_url = __OLD_TV_API__TV_API__ + "/api/circuit/"
                                            NameError: global name '__OLD_TV_API__TV_API__' is not defined
                                            -->End of Python script error report<--

This is version 0.1.2, installed using the repo addon.

@bbsan2k
Copy link
Owner

bbsan2k commented Oct 3, 2020

Sorry for reaching out so late - can you please try with current 0.1.3?
We will be posting a 0.2 soon with new api support as well as a better JWT token caching strategy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants