jonas-kaufmann / NowPlaying-for-TIDAL

Imitate Spotify's Now Playing feature in Discord using Game Activity
MIT License
9 stars 0 forks source link

Better artwork implementation #8

Open 1nikolas opened 1 year ago

1nikolas commented 1 year ago

When I had Windows on my PC I was using this app and it worked great. Only problem: you have to wait for artworks. So I switched to Linux. On Linux there is no official client so I found tidal-hifi which is basically a custom client for Linux. This client has a Discord RPC plugin baked in the client and I was confused on why artworks were working instantly.

So I figured out it somehow uses a URL as the artwork instead of constantly uploading artworks as assets. The image URL loaded on discord looks like this https://media.discordapp.net/external/c78dDCeR1nLDcfVlaxW7s1AzhrdPqhOIbIxjtv0zJw8/https/resources.tidal.com/images/99baaa31/52a0/40ee/a8d0/4525fb5f8a02/640x640.jpg (basically a proxy for the artwork image). As far as I understand if you just set the largeImageKey to an image url, it just works. I haven't tested this, I just wanted to drop this here in case it can improve the app.

1nikolas commented 1 year ago

Credits to this guy https://github.com/Mastermindzh/tidal-hifi/pull/84

jonas-kaufmann commented 1 year ago

Thanks a lot for bringing this to my attention. I am currently also a Linux user and there I don't use Discord RPC anymore. I am simply accessing TIDAL through my browser, which gives me access to the hifi quality setting. Beyond that, I don't notice a difference. Also, in my opinion tidal-hifi is the much better approach since the necessary information can be extracted directly from the DOM. It should also work under Windows with the only downside being that we can't access master quality. The latter point is the only advantage my approach has but compared to tidal-hifi, it is quite brittle. For example, TIDAL changed what they write to their log file (https://github.com/Kaufi-Jonas/NowPlaying-for-TIDAL/issues/7). I used it to extract a token to access their internal API. Even if I fix this now my application might stop working at any time again when they decide to change things. I am therefore going to archive this repository. It was definitely fun working on this though and having world-wide interaction / contribution for the first time in my life for an open-source software project.