Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

HTTPS constant for album artwork #93

Open
baf opened this issue Sep 9, 2024 · 8 comments
Open

HTTPS constant for album artwork #93

baf opened this issue Sep 9, 2024 · 8 comments

Comments

@baf
Copy link

baf commented Sep 9, 2024

Hello - thanks for the great plugin. Can the following constant be changed to use the HTTPS URL (http://resources.tidal.com/images/), or is there a reason to maintain the HTTP URL?

use constant IURL => 'http://resources.tidal.com/images/';

It seems to cause problems for me in loading some album artwork when LMS is behind a reverse proxy that uses HTTPS. As far as I can tell, this is because LMS sometimes returns a 301 to the HTTP URL to fetch album art instead of proxying it, but the browser refuses to follow the redirect because the parent page is using HTTPS.

@michaelherger
Copy link
Owner

By using http instead of https more devices (in particular original SB hardware) can display it without having to use LMS' resizing. Saves a few CPU cycles.

Under which circumstances would the full, original image URL be used in the web UI? I thought the web UI was almost always using a resized version anyway.

@baf
Copy link
Author

baf commented Sep 10, 2024

Thanks, @michaelherger, that makes sense for those older devices.

I thought so too, and I'm still trying to figure out why this happens, but in some cases LMS returns a 301 and the album art is fetched directly from Tidal. I seem to be able to reproduce this consistently with albums favorited in Tidal if I browse in LMS to Tidal > Albums. The result is a mix of proxied/resized images and 301 redirects directly to Tidal. These work fine if the front end of LMS is HTTP, but not when proxied through HTTPS, since the browser will refuse to load the mixed content.

image

@michaelherger
Copy link
Owner

Well, that screenshot certainly is helpful for those in the know 😁. Where would the 1280x1280.jpg links come from? Are they https, but are referred to from LMS?

@baf
Copy link
Author

baf commented Sep 10, 2024

😁 hopefully this one is more helpful. I bypassed my HTTPS reverse proxy for this, so this is HTTP all the way - in this case, the 301 is successful and the album art is displayed.

image

@michaelherger
Copy link
Owner

Could you configure your reverse proxy to "upgrade" http requests? Or add an add-on to your browser?

@baf
Copy link
Author

baf commented Sep 10, 2024

The reverse proxy effectively does upgrade requests, but it only proxies traffic toward LMS (actually running in a Home Assistant add-on in my case), so when my browser receives the 301 out to Tidal that traffic won't be proxied.

My quick fix so far is to change the constant that I quoted in my first message to HTTPS, which works around the issue. I know that will break with plugin upgrades, so if you are able to make that a config setting it would be appreciated, but not a huge deal.

@michaelherger
Copy link
Owner

Until then you could use a browser add-on which would upgrade the requests. But then plugin updates aren't too numerous anyway...

(reminds me I should try integrating LMS in a HA dashboard as well...)

@baf
Copy link
Author

baf commented Sep 11, 2024

(reminds me I should try integrating LMS in a HA dashboard as well...)

It works really well - I was worried I'd have to find another solution when Logitech ended support for the old Tidal plugin, so thanks so much for writing this one 😁. I use a panel_custom: directive in HA config to add the LMS add-on (https://github.com/pssc/ha-addon-lms) to the sidebar and set the Material skin as default, which makes it work well in a browser or the HA mobile app.

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

No branches or pull requests

2 participants