DeezerKodi icon indicating copy to clipboard operation
DeezerKodi copied to clipboard

Update API to make it back

Open davy39 opened this issue 1 year ago • 10 comments

Hi, I got this nice addon working again. Would you like to merge the changes ? Thanks for your work !

davy39 avatar Dec 07 '24 17:12 davy39

Hello, Thank you for the updated version. I can log in, I have access to my favorites, but when I'm trying to play a song, I got the following error: 2025-01-11 12:24:40.097 T:8077 info : DeezerKodi: Starting DeezerKodi v3.0.0 2025-01-11 12:24:40.097 T:8077 info : DeezerKodi: Initializing router with location /tracks/114698110/play 2025-01-11 12:24:40.098 T:8077 info : DeezerKodi: Connection: Requesting streaming for track with id 114698110 ... 2025-01-11 12:24:40.264 T:8077 error : EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<-- - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS! Error Type: <class 'KeyError'> Error Contents: 'MD5_ORIGIN' Traceback (most recent call last): File "/storage/.kodi/addons/plugin.audio.deezer/addon.py", line 13, in APP.run() File "/storage/.kodi/addons/plugin.audio.deezer/app/application.py", line 53, in run items = self.__router.route(self) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/storage/.kodi/addons/plugin.audio.deezer/app/http/router.py", line 58, in route return action(**parameters) ^^^^^^^^^^^^^^^^^^^^ File "/storage/.kodi/addons/plugin.audio.deezer/app/actions/tracks_actions.py", line 21, in play url = Api.instance().request_streaming(identifiant) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/storage/.kodi/addons/plugin.audio.deezer/app/http/api.py", line 363, in request_streaming md5_origin = t_data['MD5_ORIGIN'] ~~~~~~^^^^^^^^^^^^^^ KeyError: 'MD5_ORIGIN' -->End of Python script error report<--

Do you know how to fix it?

maskimfr avatar Jan 11 '25 11:01 maskimfr

Hi, thanks for debugging. Try new version 3.0.1.

davy39 avatar Jan 11 '25 12:01 davy39

Thanks for the update. Now I can sometimes play songs. When the song play, I have the following error:

2025-01-11 16:59:30.227 T:5266    error <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'ZeroDivisionError'>
                                                   Error Contents: float division by zero
                                                   Traceback (most recent call last):
                                                     File "/storage/.kodi/addons/script.ryot/resources/lib/monitor.py", line 20, in onNotification
                                                       self.scrobbler.scrobble(xbmc.Player())
                                                     File "/storage/.kodi/addons/script.ryot/resources/lib/scrobbler.py", line 31, in scrobble
                                                       progress = (current_time / duration) * 100
                                                                   ~~~~~~~~~~~~~^~~~~~~~~~
                                                   ZeroDivisionError: float division by zero
                                                   -->End of Python script error report<--

In this case, the song plays fine.

But most of the time, Kodi exit and restart:

2025-01-11 16:56:22.437 T:4453     info <general>: DeezerKodi: Starting DeezerKodi v3.0.1
2025-01-11 16:56:22.437 T:4453     info <general>: DeezerKodi: Initializing router with location /tracks/2485108/play
2025-01-11 16:56:22.438 T:4453     info <general>: DeezerKodi: Connection: Requesting streaming for track with id 2485108 ...
2025-01-11 16:56:23.073 T:3888    error <general>: Init: Error opening file /storage/.kodi/temp/2485108
2025-01-11 16:56:23.073 T:3888    error <general>: CAudioDecoder: Unable to Init Codec while loading file /storage/.kodi/temp/2485108
2025-01-11 16:56:23.073 T:3888  warning <general>: PAPlayer::QueueNextFileEx - Failed to create the decoder
2025-01-11 16:56:23.315 T:3832     info <general>: Loading skin file: MusicVisualisation.xml, load type: KEEP_IN_MEMORY
2025-01-11 16:56:23.701 T:3832  critical <general>: Logic error due to two concurrent busydialogs, this is a known issue. The application will exit.

Tell me if you need more details to debug.

And one question: I guess the quality is standard (MP3). Is it possible to have HiFi (FLAC)?

maskimfr avatar Jan 11 '25 16:01 maskimfr

  • For the first error, I guess it's not coming from this plugin but from your ryot plugin, try to disable it to see if that change something.
  • I don't understand the second one, since I can't reproduce it... Could you give me your OS, Kodi version, skin, and which file it fails to play ?

I tried to add a mp3 extension to the temporary file that is played in v3.0.2. You can have a try.

It should play the best quality possible with your Deezer account, so if you're a free user should be mp3 128kps. Could also be Flac if you're premium.

davy39 avatar Jan 11 '25 17:01 davy39

Hello, Thank you for this modification, it's working now. I'm using Coreelec on an Ugoos am6b+.

And about FLAC, I have a Family subscription, but I got only MP3_128. I don't know why my .kodi/temp/deezer-api.pickle contained only MP3_128 in available_format. After deleting this file, the new generated one contains FLAC and now the tracks are played in FLAC.

By the way, maybe it should be better to store deezer-api.pickle file in the userdata/addons folder as it contains some secrets that should not be accessible to other addons.

Thank you very much for your work, now I can listen to Deezer with Kodi with FLAC quality.

maskimfr avatar Jan 12 '25 10:01 maskimfr

Hi, Thanks for your suggestion, I did change the pickle path to addon_data.

By the way, I change the repos path to my github since @Valentin271 is not answering to this PR.

Updates will be automated from now.

davy39 avatar Jan 12 '25 12:01 davy39

Hello @davy39 ! That's great news that the add-on works with your fixes. How can I install your fork on Kodi? I don't see a .zip file to download.

gabriel-tandil avatar Sep 10 '25 16:09 gabriel-tandil

https://github.com/davy39/DeezerKodi/blob/master/plugin.audio.deezer%2Fplugin.audio.deezer-3.0.3.zip

davy39 avatar Sep 10 '25 18:09 davy39

Thanks @davy39 , now the add-on works. However, after playing a few songs, Kodi restarts. I'll try to get a log to see if it says anything useful. It's a pity that they don't merge your PR, but you could adjust your fork and add a version there so that you can point people who ask in the forums about a Deezer add-on for Kodi to use that one.

gabriel-tandil avatar Sep 11 '25 00:09 gabriel-tandil

Hi everyone!

I'm glad to see so much people involved in this project. I unfortunately no longer have time nor energy to maintain it. I've made a post just now in #34 to try to handover the maintenance in some way so that you could go ahead with this.

Valentin271 avatar Dec 01 '25 18:12 Valentin271