Sam-Max / plugin.video.jacktook

A Kodi addon for torrent finding and streaming
GNU General Public License v3.0
52 stars 9 forks source link

[1.7] Type Error in premiumize_api #8

Closed asylumexp closed 9 months ago

asylumexp commented 9 months ago

This error occurs for me whenever any action with the plugin is performed (authorising or trying to use the plugin): 2024-02-23 09:37:45.452 T:22460 error : EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--

Sam-Max commented 9 months ago

Which addon version are you using?. I tested again authorize to premiumize and works fine without anny issue. Also give more details about the steps that lead you to that error, to reproduce by myself.

asylumexp commented 9 months ago

Im using the latest addon version, tried the github version and the repository version in case there was a difference.

The steps i took from start to end was:

Also to note, I accidentally clicked on the addon before configuring it, and it still said the same error, even when it wasn't configured to use debrid or to authorise yet.

asylumexp commented 9 months ago

Im using the latest addon version, tried the github version and the repository version in case there was a difference.

The steps i took from start to end was:

  • Installed Kodi 20.4
  • Installed the repository by downloading the zip from github
  • Installed the plugin via the repository
  • Configured it to use Debrid and Torrentio
  • Inputted Premiumize api key and hit authorise

Also to note, I accidentally clicked on the addon before configuring it, and it still said the same error, even when it wasn't configured to use debrid or to authorise yet.

Tried also on Kodi 19.5, same error.

Only thing I could think of is the version of Python installed on my machine, but I wouldn't know if it uses an included version of Python that comes with Kodi or otherwise. I could try install another version if you tell me which one you have installed? (I have 3.11 installed).

Sam-Max commented 9 months ago

Don't input manually Premiumize api key, leave blank the field. Just click authorize and when process is finished, the api key will be filled automatically.

asylumexp commented 9 months ago

Found out the issue, its that it was running with Python 3.8, I'm assuming this was bundled in with Kodi, which is what causes it to crash, as str | int isn't available until 3.10, also had errors for -> dict[str, Any] | None and torrent_hashes: list[str].

I'm assuming theres a way to get a newer version of python for Kodi to use or for it to use the system version. But if there isn't these lines should probably be changed, or at least have something in the readme about them.

asylumexp commented 9 months ago

I fixed it for myself by changing str | int to Union[str, int] from typing, then deleted the other two that were causing issues

Sam-Max commented 9 months ago

Make a pull request with those fixes if you can, I would appreciate.