Coder Social home page Coder Social logo

Music doesn't play in Kodi Matrix about plex-for-kodi HOT 15 OPEN

wormvortex avatar wormvortex commented on August 25, 2022 4

Since upgrading to matrix the plex-for-kodi app will not play music. Videos load fine but music just opens the player and stays at 0 seconds no matter what I try and play.

Details:

  • Add-on version: latest
  • Kodi version: matrix
  • OS Platform: libreleec
  • Hardware: pi4

from plex-for-kodi.

Comments (15)

Asgardsurfer avatar Asgardsurfer commented on July 30, 2021

I'm seeing the exact same thing, thanks in advance to those that can fix this!

Details:

Add-on version: latest
Kodi version: matrix
OS Platform: Android
Hardware: minix U1 (Amlogic S905)

from plex-for-kodi.

Indrikis480 avatar Indrikis480 commented on August 13, 2021 1

Greetings. A similar problem. Hope for a solution soon. Thanks for your work.

Details:

Add-on version: latest
Kodi version: matrix
OS Platform: Android 9.0
Hardware: Ugoos AM6 Plus (Amlogic S922XJ)

from plex-for-kodi.

SonGoku90 avatar SonGoku90 commented on August 16, 2021 1

I also have such a problem on nvidia shield in kodi 19.1

from plex-for-kodi.

Buri avatar Buri commented on September 18, 2021

It looks like the playlist data coming in is wrong?

2021-09-18 10:51:25.306 T:2641    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: a bytes-like object is required, not 'str'
                                                   Traceback (most recent call last):
                                                     File "/home/buri/.kodi/addons/script.plex/lib/windows/kodigui.py", line 105, in onInit
                                                       self.onFirstInit()
                                                     File "/home/buri/.kodi/addons/script.plex/lib/windows/musicplayer.py", line 64, in onFirstInit
                                                       self.play()
                                                     File "/home/buri/.kodi/addons/script.plex/lib/windows/musicplayer.py", line 152, in play
                                                       player.PLAYER.playAudioPlaylist(self.playlist, startpos=list(self.playlist.items()).index(self.track), fanart=fanart)
                                                     File "/home/buri/.kodi/addons/script.plex/lib/player.py", line 858, in playAudioPlaylist
                                                       url, li = self.createTrackListItem(track, fanart, index=index)
                                                     File "/home/buri/.kodi/addons/script.plex/lib/player.py", line 874, in createTrackListItem
                                                       data = base64.urlsafe_b64encode(track.serialize())
                                                     File "/usr/lib64/python3.6/base64.py", line 118, in urlsafe_b64encode
                                                       return b64encode(s).translate(_urlsafe_encode_translation)
                                                     File "/usr/lib64/python3.6/base64.py", line 58, in b64encode
                                                       encoded = binascii.b2a_base64(s, newline=False)
                                                   TypeError: a bytes-like object is required, not 'str'
                                                   -->End of Python script error report<--

from plex-for-kodi.

jhoms avatar jhoms commented on September 26, 2021

Found a way to fix it. Not sure it is the best though. I made changes in plugin.py and player.py:

~/.kodi/addons/script.plex/plugin.py

play()
#44
-        plexObject = plexobjects.PlexObject.deSerialize(base64.urlsafe_b64decode(data))
+        plexObject = plexobjects.PlexObject.deSerialize(base64.urlsafe_b64decode(data[1:]))

~/.kodi/addons/script.plexli/player.py

extractTrackInfo()

#516
-            track = plexobjects.PlexObject.deSerialize(base64.urlsafe_b64decode(data.encode('utf-8')))
+            track = plexobjects.PlexObject.deSerialize(base64.urlsafe_b64decode(data[1:].encode('utf-8')))

createTrackListItem()

#870
-        data = base64.urlsafe_b64encode(track.serialize())
+        data = base64.urlsafe_b64encode(bytearray(track.serialize(),'utf-8'))

Hope it helps.

from plex-for-kodi.

basildane avatar basildane commented on November 27, 2021

Found a way to fix it. Not sure it is the best though. I made changes in plugin.py and player.py:

~/.kodi/addons/script.plex/plugin.py

play()
#44
-        plexObject = plexobjects.PlexObject.deSerialize(base64.urlsafe_b64decode(data))
+        plexObject = plexobjects.PlexObject.deSerialize(base64.urlsafe_b64decode(data[1:]))

~/.kodi/addons/script.plexli/player.py

extractTrackInfo()

#516
-            track = plexobjects.PlexObject.deSerialize(base64.urlsafe_b64decode(data.encode('utf-8')))
+            track = plexobjects.PlexObject.deSerialize(base64.urlsafe_b64decode(data[1:].encode('utf-8')))

createTrackListItem()

#870
-        data = base64.urlsafe_b64encode(track.serialize())
+        data = base64.urlsafe_b64encode(bytearray(track.serialize(),'utf-8'))

Hope it helps.

I have an Nvidia Shield running Kodi / Plex. Where and how would I even find these files?

from plex-for-kodi.

jhoms avatar jhoms commented on November 27, 2021

Found a way to fix it. Not sure it is the best though. I made changes in plugin.py and player.py:

~/.kodi/addons/script.plex/plugin.py

play()
#44
-        plexObject = plexobjects.PlexObject.deSerialize(base64.urlsafe_b64decode(data))
+        plexObject = plexobjects.PlexObject.deSerialize(base64.urlsafe_b64decode(data[1:]))

~/.kodi/addons/script.plexli/player.py

extractTrackInfo()

#516
-            track = plexobjects.PlexObject.deSerialize(base64.urlsafe_b64decode(data.encode('utf-8')))
+            track = plexobjects.PlexObject.deSerialize(base64.urlsafe_b64decode(data[1:].encode('utf-8')))

createTrackListItem()

#870
-        data = base64.urlsafe_b64encode(track.serialize())
+        data = base64.urlsafe_b64encode(bytearray(track.serialize(),'utf-8'))

Hope it helps.

I have an Nvidia Shield running Kodi / Plex. Where and how would I even find these files?

Maybe this could help

https://forum.kodi.tv/showthread.php?tid=285399

from plex-for-kodi.

basildane avatar basildane commented on November 28, 2021

@jhoms That worked PERFECTLY! Thank you.
I am now able to use Plex for the first time since this summer!

I do have some questions. Why did it break in the first place? And why not put this fix in the production code?

Also, my Shield says the current version is 0.3.4, but GitHub says latest version is 0.1.6.
I just want to have this work - permanently and understand what the situation is.

And thanks for responding!

from plex-for-kodi.

jhoms avatar jhoms commented on November 28, 2021 1

Why did it break in the first place?

My guess is that with Matrix upgrade some python libraries got upgraded to and they work different.

And why not put this fix in the production code?

I don't know. I was just in the same situation as you, but with my little knowledge of python found a workaround. I am glad it is working for you too.

Regarding the versions, I don't know. Maybe the people who takes care of this piece of code can. They can also make this change in the original code (even find a better fix) so future upgrades work fine out of the box.

from plex-for-kodi.

DarkissGit avatar DarkissGit commented on February 23, 2022

This solution worked for me.

Details:

Add-on version: latest (0.3.4)
Kodi version: Matrix v19.3
OS Platform: Android 11.0
Hardware: Nvidia Shield

Thx @jhoms

from plex-for-kodi.

jaysh-yin avatar jaysh-yin commented on June 3, 2022

Found a way to fix it. Not sure it is the best though. I made changes in plugin.py and player.py:

~/.kodi/addons/script.plex/plugin.py

play()
#44
-        plexObject = plexobjects.PlexObject.deSerialize(base64.urlsafe_b64decode(data))
+        plexObject = plexobjects.PlexObject.deSerialize(base64.urlsafe_b64decode(data[1:]))

~/.kodi/addons/script.plexli/player.py

extractTrackInfo()

#516
-            track = plexobjects.PlexObject.deSerialize(base64.urlsafe_b64decode(data.encode('utf-8')))
+            track = plexobjects.PlexObject.deSerialize(base64.urlsafe_b64decode(data[1:].encode('utf-8')))

createTrackListItem()

#870
-        data = base64.urlsafe_b64encode(track.serialize())
+        data = base64.urlsafe_b64encode(bytearray(track.serialize(),'utf-8'))

Hope it helps.

it's worked!Thank you very much!!
But,have a new issues.
when click “Next Track” or “Previous Track” button,plex Add-on will crash.

from plex-for-kodi.

jhoms avatar jhoms commented on June 18, 2022

Found a way to fix it. Not sure it is the best though. I made changes in plugin.py and player.py:

~/.kodi/addons/script.plex/plugin.py

play()
#44
-        plexObject = plexobjects.PlexObject.deSerialize(base64.urlsafe_b64decode(data))
+        plexObject = plexobjects.PlexObject.deSerialize(base64.urlsafe_b64decode(data[1:]))

~/.kodi/addons/script.plexli/player.py

extractTrackInfo()

#516
-            track = plexobjects.PlexObject.deSerialize(base64.urlsafe_b64decode(data.encode('utf-8')))
+            track = plexobjects.PlexObject.deSerialize(base64.urlsafe_b64decode(data[1:].encode('utf-8')))

createTrackListItem()

#870
-        data = base64.urlsafe_b64encode(track.serialize())
+        data = base64.urlsafe_b64encode(bytearray(track.serialize(),'utf-8'))

Hope it helps.

it's worked!Thank you very much!! But,have a new issues. when click “Next Track” or “Previous Track” button,plex Add-on will crash.

I was trying to reproduce your problem but in my installation is working fine, so it is hard for me to find a way to fix it. Sorry.

from plex-for-kodi.

Kotva666 avatar Kotva666 commented on June 19, 2022

I have the same problem which as you can see has been there since 2021 ... today I installed the new libreelec on RPi4 and the plex script on it, everything works except the music itself. Is it such a problem for the developers to care and fix this bug? When I download the Composite add-on I can play the audio in it without any problems.

from plex-for-kodi.

yangn0 avatar yangn0 commented on August 6, 2022

when click “Next Track” or “Previous Track” button,plex Add-on will crash.

me too.it's worked.but when click “Next Track” or “Previous Track” button,plex Add-on will crash.

from plex-for-kodi.

ericconnelly avatar ericconnelly commented on August 25, 2022

Same

Add-on version: latest
Kodi version: matrix
OS Platform: libreleec
Hardware: pi4

from plex-for-kodi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.