pkkid / python-plexapi

Python bindings for the Plex API.
BSD 3-Clause "New" or "Revised" License
1.15k stars 200 forks source link

plexapi tidal integration #671

Open 62274677 opened 3 years ago

62274677 commented 3 years ago

Does the plexapi include/are there plans to include tidal support? I am looking to write a script that syncs a playqueue between youtube and plex/plexamp. If I can only find the currently playing songs and up next from plex, that is alright, but it would be wonderful if I could also add tidal songs to the playqueue programmatically. I am new to the plexapi, so if this exists already I apologize; I couldn't find any reference to tidal other than a single command in the docs.

darovic commented 2 years ago

I was going to try this, but my head is swimming looking through the Plex logs trying to figure out the relevant APIs.

Does the attached log file assist in any way? Amongst allt he noise, it has me:

  1. creating a new playlist named SomePlaylistName
  2. adding a Tidal song to my Library (Jericho by Celldweller)
  3. adding that song to the playlist SomePlaylistName
  4. playing that song

partial_log.txt

blacktwin commented 2 years ago

@darovic Opening your browser Inspect tool and checking the Network traffic/calls is where you should start to find the API calls for the actions you perform from TIDAL. Logs won't really help you.

@62274677 Right now there is only the ability to view the hubs from TIDAL . The rest of the actions and data gathering will need to be added. I'd assume we can reuse some code for actions but the data and endpoints need to be mapped out first.

darovic commented 2 years ago

@blacktwin The calls are being made by the plexamp desktop application, not a web application. The connections are encrypted so capturing the traffic wasn't helpful either. Tidal itself doesn't provide an interface to interact with a PMS.

jjlawren commented 2 years ago

@darovic have you tried with the extra header suggestion from #905?

spauldhaliwal commented 2 years ago

It seems to me all of the endpoints used by Tidal don't work unless you have special permissions. I tried, even with the external-media header, and got:

{ "Error": { "error": "Forbidden", "message": "'{user_id}' is NOT permitted to access restricted endpoint '/hubs/promoted' on '{app_name}/?': Feature not permitted! Missing feature(s): podcasts", "statusCode": 403 } }

This was for the podcasts endpoints but I received the same errors for Tidal.

trankillity commented 7 months ago

Just adding my voice that I'd love to see this integrated. Even if it's just to a basic level with track details coming through, not necessarily any library API support. Using the Home Assistant Plex integration (which I believe uses python-plexapi) just shows the last local track played in the entity attributes.