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

Support for Tidal with mopidy-tidal #1901

Draft
wants to merge 13 commits into
base: future3/develop
Choose a base branch
from

Conversation

reptilex
Copy link

I have created a component for mopidy tidal, it's in a way a very hacky because I'm using websockets and json rpc to call directly on mopidy services. Probably there are better ways to do this, but I might need a few hints to improve my current approach.

This is the current code, it uses an already installed mopidy with tidal.

The current state and todos:

  • manual mopidy card entries can trigger playing mopidy tidal songs, albums and playlists
  • most methods of playermdp have been implemented in playermopidy
  • there is a rudimentary copy of your thread usage in place
  • there is a state poll function with threads (currently every 10 seconds)
  • find out how to avoid lock of pulseaudio by mopidy
  • create a bash installation script for mopidy tidal
  • check whether this is the best approach or we should build on tidalapi on the jukebox (I could not figure out how gstreamer works, getting albums and playlists is easy but streaming ...)
  • in case this approach is good enough discuss improvements of websocket and threading functionality otherwise need hints on gstreamer
  • improve on the state object and poll
  • discuss how reconcile "player" functionality so that it is generic for mpd or mopidy-tidal, currently it's all based on folders
  • check how to accomodate for webapp player functionality with rest of jukebox
  • add mopidy tidal card creation on webapp (building on a zero is a pain)

@s-martin s-martin added the future3 Relates to future3 development label Nov 15, 2022
@s-martin s-martin linked an issue Dec 19, 2022 that may be closed by this pull request
12 tasks
@s-martin s-martin changed the title Future3/mopidytidal Support for Tidal with mopidy-tidal Dec 26, 2022
@pabera
Copy link
Collaborator

pabera commented Jan 4, 2023

Just a heads up: Without deep diving into your code, how does Mopidy-Tidal access Tidal music? As far as I know, Tidal does not grant access to their API without a commercial contract, similar to Amazon or Spotify. This is only achieved either through old libraries (in case of Spotify) or reverse engineering. Something those companies typically do not allow. If my assumptions hold true, this would be the case for Tidal as well.
This is a reason why we have not integrated any commercial streaming service to avoid any issues with their terms and conditions in future3

@reptilex
Copy link
Author

reptilex commented Jan 5, 2023

I'm using the mopidy-tidal (uses tidalapi python package) which as opposed to spotify library in the RPi-Jukebox 2 version still works. I haven't found any indication as to how the API at Tidal may or may not be used. In any case without a streaming service as base for RPI-Jukebox the software for me becomes worthless. The main use case for me was to make use of my existent subscriptions to play stuff for my kids. If no service is "allowed" or supported, than I can buy the Toniebox as well, since I have to buy the content to be able to deliver it to the kids.

@s-martin
Copy link
Collaborator

s-martin commented Jan 5, 2023

Any streaming service has Terms of Service (ToS) how their content may be consumed.

If a third party open source library or other software (like mopidy) works is not always a clear indication, if these ToS are honored.

From my personal point of view Phoniebox should provide an implementation which is in line with the ToS of the respective streaming service. I have no idea, if this PR is in line with Tidal's ToS. Generally I would ask creators of PR's for streaming services to provide some info on the ToS implications.
To be fair @MiczFlor and the maintainers of Phoniebox have not yet layed out a finished "ruleset" how we integrate streaming services.

Nevertheless providing implementations for streaming services is more than welcome as we all are interested in making a Phoniebox, which provides features users want! And maintainers are well aware that many users want to use their streaming subscriptions.

N.B.
A little bit of Spotify history (as far as I know):

the Phoniebox Spotify implementation was using an interface (libspotify), which was already discontinued by Spotify in 2015(?).

Nevertheless it worked for many years and Spotify somehow tolerated the usage. Spotify dropped this interface in May 2021 and since then mopidy-spotify in Phoniebox didn't work anymore.

mopidy-spotify seems to be able to provide a new working implementation now, but I personally haven't checked yet, if this is in line with Spotify's ToS.

It looks like Spotify only allows to use their Web API, which seems a little difficult to use in Phoniebox, but as I said PRs are more than welcome.

@sebrep
Copy link
Contributor

sebrep commented Jan 5, 2023

I know about the history of spotify, as far as I know there is no working streaming service on the WebAPI of spotify, that is why I switched to tidal. I have made a request to Tidal to explain there ToS, hopefully I get a clear document that can make this transparent. If the API would allow streaming as needed I would continue on. I fully understand we need this to make this a supported extension. Thanks for at least taking a look into the topic. I will keep you updated.

@pabera
Copy link
Collaborator

pabera commented Apr 7, 2023

Do you still plan to finish this at some point?

@sebrep
Copy link
Contributor

sebrep commented Apr 11, 2023

No, since the tidalapi is not fully "legal" it seems RPI Jukebox does not want to add it, and I understand. I actually have abandoned RPI Jukebox and run everything through mopidy. It is much more stable and allows for this api to be used. It there is an RFID "frontend" for mopidy for it, that is not as nice as the one from RPI but works well.

https://github.com/confirm/mopidy-pummeluff
https://github.com/tehkillerbee/mopidy-tidal

Use this two mopidy extensions and you are done. It was much easier than RPI Jukebox. The only thing is that you need to look into the logs when it stopped working to reinitialize a token on tidal. But that's it. And I had to add a script for a sound when the raspberry starts again. But that was much easier than anything on RPI so far.

@@ -31,6 +31,11 @@ RUN apt-get update && apt-get install -qq -y \
COPY . ${INSTALLATION_PATH}

RUN pip3 install --no-cache-dir -r ${INSTALLATION_PATH}/requirements.txt

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this necessary, if the packages are mentioned in requirements.txt?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: new component for Mopidy Tidal created on Future 3
4 participants