Search code examples
pythondeezer

Current "Flow" track name using Deezer NativeSDK


I'm using the Deezer NativeSDK Python wrapper available here : https://github.com/deezer/native-sdk-samples

I'm playing user's "Flow" radio deezer_app.load_content("dzradio:///user-12345".encode('utf-8')) . How can I recover the playing track information or at least the track id ?

Thank you


Solution

  • The information is available through the QUEUELIST_TRACK_SELECTED event. The function Player.event_track_selected_dzapiinfo(event) will return the JSON of the current track selected.

    I have updated the PythonSample of https://github.com/deezer/native-sdk-samples to illustrate it. (you can check myDeezerApp.py)

    The corresponding SDK function wrappers have been added in (deezer_import.py)

    libdeezer.dz_player_event_track_selected_dzapiinfo.argtypes = [c_void_p]
    libdeezer.dz_player_event_track_selected_dzapiinfo.restype = c_char_p