Resource icon

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

T_X

New Member
Thanks for this great browser source! One (probably out-of-scope :D) feature request / wish:

I would like to use it with music from Jamendo.com. I've tried the combination of the Firefox Web Scrobbler plugin. Which detects the Jamendo web player and exports to Last.fm. And your browser source seems to pick it up fine from Last.fm again.

One tiny thing I'm missing is license information. All tracks on Jamendo.com are under a Creative Commons license. And I think I would need to display this license information when publically streaming it. At least a matching, small CC-BY-<SA|NC|ND>* icon should be displayed. But I'm not sure if Last.fm's API has this information.

(And if not, having this browser source check on the Jamendo API itself for the license would probably be out-of-scope, I guess.)
 

Xaymar

Active Member
But I'm not sure if Last.fm's API has this information.
It does not, or at least not in any way I can query. Since I intend to only support the Last.FM API, this is out of scope as you already said.
 

webcamcals

New Member
I'm trying to get this set up the new way and can't get it to work...

My understanding of how it's supposed to work now / what i tried is:
1) Create an API account at lastfm
2) Go to the new plugin url https://tools.xaymar.com/nowplaying.html?user=YOURLASTFMUSERNAME, replace the string at the end with your lastfm username
3) Ctrl+s save that page to your desktop as an htm file
4) Open that htm file in notepad, ctrl+f for "api", and replace the api key with the one you got from making your own lastfm API account
5) Point your browser source in OBS to the edited local htm file

Is there something I'm missing? I wasn't sure about the "Callback URL" field on the Lastfm API form, and left it blank.
edit: I'm wondering if there's a different way I need to tell it my username maybe? Bc now that I think about it, I don't know where it would be getting that from
 

webcamcals

New Member
What's the best way to provide the username when it's a local file? It normally gets the username from "?user=YOURLASTFMUSERNAME" at the end of the URL, right, but you can't put a "?" in a windows filename? Ctrl+fing for "user" in the html file brings me to this line:

JavaScript:
function requestUpdate(api_key, user) {
                let url = `https://ws.audioscrobbler.com/2.0/?api_key=${api_key}&method=user.getRecentTracks&user=${user}&extended=1&limit=1&format=json`;

Changing "user" inside of the brackets isn't working for me; do I have to format it differently? Sorry if this is a stupid question but I don't know programming at all. I tried doing it some other ways too but I really don't know what I'm doing
 

webcamcals

New Member
Omg I got it working!! I had this box checked in OBS Browser Source
1698360837181.png
and you aren't allowed to edit the text field when it's checked.
UNchecking it and formatting my URL like so:
Code:
file:///D:/Documents/lastfmnp.htm?user=USERNAME
did the trick!
Edit: I'll add for anyone else who is tinkering with it, Lastfm is not super speedy with picking up on scrobbling tracks atm, so if you're testing it, make sure your lastfm page shows something currently playing! I panicked for a second thinking I broke it, but lastfm just hadn't started reflecting the new track playing yet

Thanks for your help and ty so much for this plugin!! It's been my favorite way to show my now playing track for a long time!
 
Top