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

Update API to make it back #33

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

Conversation

davy39
Copy link

@davy39 davy39 commented Dec 7, 2024

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

@maskimfr
Copy link

maskimfr commented Jan 11, 2025

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?

@davy39
Copy link
Author

davy39 commented Jan 11, 2025

Hi, thanks for debugging.
Try new version 3.0.1.

@maskimfr
Copy link

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)?

@davy39
Copy link
Author

davy39 commented Jan 11, 2025

  • 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.

@maskimfr
Copy link

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.

@davy39
Copy link
Author

davy39 commented Jan 12, 2025

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.

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

Successfully merging this pull request may close these issues.

2 participants