add-ons / plugin.video.streamz

Kodi add-on to watch video-on-demand content from the Streamz service.
https://github.com/add-ons/plugin.video.streamz/wiki
GNU General Public License v3.0
19 stars 4 forks source link

TypeError: Unicode-objects must be encoded before hashing #33

Closed NofanTasi closed 3 years ago

NofanTasi commented 3 years ago

First of all Michael, thanks for great work on various plugins!

I have streamz working fine on two arm CoreELEC Leia TV boxes.

I also have an own built x86_64 gentoo HTPC running Kodi.

It is in fact my main HTPC and it ran streamz just fine as well in Leia.

But gentoo (which is always bleeding edge) switched to Matrix (kodi-19.0_beta2) and almost all addons I need (vrt-nu, vrt-radio, vtm-go, yello, netflix, ...) work fine.

so now streamz:

It starts and can browse content but content does not play. This is not the URL parser defect you fixed in inputstream adaptive (I have addon with fix). It seems something else goes on.

I may be missing something obvious

here is relevant part in the log

--

2021-01-11 20:38:48.531 T:23789 ERROR : [plugin.video.streamz] [resources.lib.service] Unicode-objects must be encoded before hashing Traceback (most recent call last): File "/home/kodi/.kodi/addons/plugin.video.streamz/resources/lib/service.py", line 65, in _update_metadata success = Metadata().fetch_metadata(callback=update_status) File "/home/kodi/.kodi/addons/plugin.video.streamz/resources/lib/modules/metadata.py", line 49, in fetch_metadata items = self._api.get_items() File "/home/kodi/.kodi/addons/plugin.video.streamz/resources/lib/streamz/api.py", line 193, in get_items items.append(self._parse_program_teaser(item, cache=cache)) File "/home/kodi/.kodi/addons/plugin.video.streamz/resources/lib/streamz/api.py", line 472, in _parse_program_teaser program = self.get_program(item.get('target', {}).get('id'), cache=cache) File "/home/kodi/.kodi/addons/plugin.video.streamz/resources/lib/streamz/api.py", line 265, in get_program program_hash.update(program.get('id')) TypeError: Unicode-objects must be encoded before hashing 2021-01-11 20:38:50.705 T:23794 INFO : CPythonInvoker(7, /home/kodi/.kodi/addons/service.xbmc.versioncheck/resources/lib/runner.py): script successfully run 2021-01-11 20:38:50.837 T:23794 INFO : Python interpreter stopped

--

Thanks for help

michaelarnauts commented 3 years ago

Hmm, I remember this issue. I think it's already fixed in the latest master branch. Can you try that?

michaelarnauts commented 3 years ago

Yep, the fix was here: https://github.com/add-ons/plugin.video.streamz/commit/35d6cc3f25b26f87402ab22c0d3aa985c3994a52#diff-e0311d1d031c3311df80e3b1ef4f831024cbc1356989771e60b57a37c3b9d34cL265

I'll make a bugfix release soon.

NofanTasi commented 3 years ago

thanks for excellent and kind support, it seems you added .encode() ... let me try and confirm fix, then you can close report.

NofanTasi commented 3 years ago

for some reason I cannot install the ZIP plugin.video.streamz-1.0.3-master-2bec195.zip I built with following recipe

eselect python set python3.8
git clone https://github.com/xbmc/xbmc.git
cd xbmc
git checkout -b 19.0b2-Matrix 19.0b2-Matrix
cd ..
git clone https://github.com/add-ons/plugin.video.streamz.git
cd plugin.video.streamz
make zip

I get complaint "The dependency on xbmc.python version 2.26.0 could not be verified". Note that this is on gentoo and there sure is no python 2.7 (in fact I selected 3.8 since 3.9 is also there) In /usr/share/kodi/addons/xbmc.python/addon.xml I spot <addon id="xbmc.python" version="3.0.0" provider-name="Team Kodi"> Maybe you can provide a ZIP for me to test?

michaelarnauts commented 3 years ago

Sure, no problem. See below.

plugin.video.streamz-1.0.3-master-2bec195.zip plugin.video.streamz-1.0.3+matrix.1-master-2bec195.zip <- you need this

michaelarnauts commented 3 years ago

Btw, you don't need to build this addon like that. You only need to checkout the kodi repo if you want to build binary addons. For normal add-ons, you just need to download a zip from github of the latest code. For matrix, you'll need to change the xbmc.python to 3.0.0 in the addon.xml, but this is already done in the zip above.

NofanTasi commented 3 years ago

The fix works ! About building addons, it has been a while since I did so on a regular base (I used to build and provide full 64bit LE 8 for Amlogic) You are a hero

michaelarnauts commented 3 years ago

The fix works ! About building addons, it has been a while since I did so on a regular base (I used to build and provide full 64bit LE 8 for Amlogic) You are a hero

Thanks for verifying! I'll release an update. I actually forgot about that .encode(), I discovered it a few days ago when improving the testing.

mediaminister commented 3 years ago

To make a Kodi 19 Matrix compatible zip package along with the standard Kodi 18 Leia package, you need to use the command make multizip