Resource icon

Free Now Playing Display (via Last.FM) 2020-02-04

Xaymar

Active Member
"Update" Notes:
  • Reduced the update rate from 5/15 to 15/60. This about matches the time most audio players need to scrobble to Last.fm.
  • Fixed the case where track images are shown as a missing image symbol by falling back to artist images. If those artist images are also all empty, it falls back to a known working image.
 

y0himba

New Member
I love this way of displaying Now Playing in Spotify! So elegant! Is it possible for me to host the relative HTML file on my own webserver/domain and point the browser source there?
 

Xaymar

Active Member
I love this way of displaying Now Playing in Spotify! So elegant! Is it possible for me to host the relative HTML file on my own webserver/domain and point the browser source there?

Just download the file, it's self-contained. But please get your own last.fm api key.
 

y0himba

New Member
Oh absolutely. I wouldn't use your API calls! I am just unfamiliar with how to grab the HTML file.
Edit: I have an API key now. :)
 

Xaymar

Active Member
Oh absolutely. I wouldn't use your API calls! I am just unfamiliar with how to grab the HTML file.
Edit: I have an API key now. :)

Ctrl-S in any browser usually does the trick. Or 'curl -o nowplaying.html https://stream.xaymar.com/nowplaying.html' also works. Note that you don't actually need a server for the html file, you can quite literally use it as a local file with the 'file:///?:/dir' protocol (where ? is the drive and dir is a forward slash path to the file).
 

y0himba

New Member
I used curl. I'm more comfortable with command line. It's up and running locally, using my own API key. Thanks again!
 

kizzxas

New Member
Hello, I probably asking to much but can someone give me little bit of code for obs to align all text and logo to left ?
 

Xaymar

Active Member
Hello, I probably asking to much but can someone give me little bit of code for obs to align all text and logo to left ?
CSS:
body {
    text-align: left !important;
    padding-left: 8pt !important;
}

This should do the trick for the Now Playing element. If you want the track logo itself to be outside of the info box, that's going to be a lot more work.
 

kizzxas

New Member
Got a way around it by uploading it locally with own api. Now i have another question :D Do you know why I can change no image logo? For some reason YTMDesktop barely show any logo. I would like to change default 'no logo' logo to my own but then I change url's it still shows default.
PgP9kUF.png
 

Xaymar

Active Member
Do you know why I can change no image logo?
Assuming you meant "can't" instead of can. I didn't implement this due to a potential to conflict with copyright laws, but it should be possible to change the default image if you decide to do so. If the song itself has the default image set, then you'll have to figure out a way to detect that. A regular expression will probably do just fine here.
 

kizzxas

New Member
Assuming you meant "can't" instead of can. I didn't implement this due to a potential to conflict with copyright laws, but it should be possible to change the default image if you decide to do so. If the song itself has the default image set, then you'll have to figure out a way to detect that. A regular expression will probably do just fine here.
You see I don't want to change artist or song logo if it has one. I just want to change default grey logo to something less bright. Default no image logo should come from url or somehow it pulls it out from lastfm with track data ? I changed url many times and it still pulls out same no image logo. Apologies for my grammar and mistakes and thank you for any help and hard work creating this work.
 

kizzxas

New Member
Solved issue. I'm not a coding guy, trying to use common sense but it takes time then I'm blind :D
 

Xaymar

Active Member
I don't have any big issues but obs browser source spamming this:
[obs-browser: 'Now Playing'] Error: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'track') (http://absolute/D:/Twitch/nowplaying.html:177)

Any idea why ?
Sorry, no idea. There shouldn't be a way for this to happen unless you set the user= to a user that doesn't exist, which would give you "can't access property "track", data.recenttracks is undefined".
 

kizzxas

New Member
Sorry, no idea. There shouldn't be a way for this to happen unless you set the user= to a user that doesn't exist, which would give you "can't access property "track", data.recenttracks is undefined".
all code here
 

Attachments

  • 2022-11-08 10_51_38-Properties for 'Now Playing'.png
    2022-11-08 10_51_38-Properties for 'Now Playing'.png
    27.8 KB · Views: 47
  • 2022-11-08 11_00_45-OBS 28.1.1 (64-bit, windows) - Profile_ DyM nv - Scenes_ 1080p.png
    2022-11-08 11_00_45-OBS 28.1.1 (64-bit, windows) - Profile_ DyM nv - Scenes_ 1080p.png
    94.8 KB · Views: 45
  • 2022-11-08 11_02_17-Window.png
    2022-11-08 11_02_17-Window.png
    109.6 KB · Views: 47

Xaymar

Active Member
For some reason, when using your user name there are a lot of 500 errors from Last.FM. Put this code before "value.json().then...":
JavaScript:
if (value.status !== 200) {
        return;
}
 
Top