Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 21:10
    roderickvd commented #896
  • 21:09
    roderickvd assigned #899
  • 21:09
    roderickvd assigned #899
  • 21:09
    roderickvd labeled #899
  • 21:08
    roderickvd commented #899
  • 16:40
    JasonLG1979 commented #899
  • 16:40
    JasonLG1979 commented #899
  • 15:15
    JasonLG1979 commented #899
  • 15:07
    JasonLG1979 commented #899
  • 14:43
    JasonLG1979 commented #898
  • 14:17
    JasonLG1979 commented #899
  • 13:42
    JasonLG1979 commented #899
  • 10:39
    ashthespy commented #899
  • 10:35
    ashthespy commented #899
  • 09:21
    coderootme commented #898
  • 09:04
    roderickvd commented #898
  • 09:01
    JasonLG1979 commented #898
  • 08:58
    JasonLG1979 commented #898
  • 08:56
    JasonLG1979 commented #898
  • 08:54
    roderickvd commented #898
Roderick van Domburg
@roderickvd
Sonos is known to cause issues with Unifi not particularly because of Unifi but because of RSTP. It requires the venerable STP.
In other news I've picked up new-api development again and making good progress on what librespot-java calls the ApiClient, the HTTP endpoints for metadata and connect state. I'm hoping to push soon. It won't fully work yet because I have to get the dealer web socket up and running before we can publish the connect state, but these are all parts of the puzzle on the way to a working new API implementation.
Jason Gray
@JasonLG1979
@roderickvd my wired router is a ubiquiti EdgeRouter X (tiny little thing, runs Debian which is kinda cool) I have had zero issues since I got it. I think maybe it was a combination of crappy mDNS on the TPLink and Librespot causing an ack storm. As in neither is particularly well behaved so together they don't work . That's what I think is the problem. Good gear + librespot = joy. Mediocre gear + librespot = no joy. I think maybe if libmdns were better behaved maybe there would be less issue?
Roderick van Domburg
@roderickvd
I don't know. I'm not so sure it's a widespread problem. I mean, surely there are a lot of users with mediocre or mixed gear and if it really were a problem, you'd expect a storm of issue reports that we don't have.
I'm not disagreeing that libmdns could be improved so if anyone wants to take a stab at that, then please do!
Jason Gray
@JasonLG1979
I've got some reading to do before I can really tell you anything about mDNS or libmdns. I really know nothing. Everything I've said so far has been basically me talking out of my butt,lol!!!
Roderick van Domburg
@roderickvd
Yeah, asynchronous networking libraries aren't exactly bread & butter :laughing: but when I looked at it, it isn't that big of a library so it would be a nice exercise in Tokio and such.
But anyway myself I just got hooked again on the new API because like you, I want to be there when Spotify HiFi lands :sunglasses: not sure if we'll make that if Spotify keeps it promise to launch it in 2021 but let's see how I fare and can spare the time the coming weeks.
dubo-dubon-duponey
@dubo-dubon-duponey
@JasonLG1979 maybe something useful to fix / a good starting point would be librespot-org/libmdns#19 - the spurious logging is (just) an annoyance AFAIK, but it does hide a deeper issue that was outlined in the comments: the DNS parser being used (apparently forked out of https://github.com/tailhook/dns-parser) is outdated / unmaintained. One of the suggestion was to replace it with the parser from https://github.com/bluejekyll/trust-dns <- this one is apparently well maintained and widely used - it does support NSEC (which I expect to “fix” the issue in 19 itself) and also support flush cache (would make it easier to implement it in the future if we think it’s appropriate). @roderickvd and others: thoughts?
Roderick van Domburg
@roderickvd
I haven't looked at it deeply so find it difficult to give any insightful comments. But generally I encourage any form of improvement, including moving to maintained and widely-used crates.
Roderick van Domburg
@roderickvd
@TonerK7_twitter I'm trying that lyrics endpoint but so far unsuccessful.
1) this is a GET request?
2) which headers are you sending?
3) that image, what is it -- album cover?
I'm getting a 400 when I try your URL with headers "Authorization: Bearer {playlist-read token}". Is that token even correct?
Tony
@TonerK7_twitter

@roderickvd yes it's a get request

2) the two headers you must have for this request (from what I've tested) are: "authorization": "Bearer token" and "user-agent": "Spotify/8.6.80 iOS/13.5 (iPhone11,2)"

3) yes, I haven't checked yet but I think the image is the album cover so it can get the colours to use for the lyrics gui

Roderick van Domburg
@roderickvd
Ah thanks that makes sense. :+1: Working now. It's version-gated too so doing Spotify/1.0 librespot/0.4.0 didn't work but that iOS string does.
The clientLanguage parameter is optional.
Roderick van Domburg
@roderickvd
Does anyone know why the build is failing in librespot-org/librespot##891? It's a bit irritating but building just fine here.
Roderick van Domburg
@roderickvd
Never mind, got it.
malesh
@ivanmales_twitter

Hi everyone
Is it possible to use Librespot to authenticate user thru official Spotify Login dialogue? and use the token we get like that? how do we refresh this token?

Also is it possible to authorize multiple users like this, my guess is we would have to disconnect librespot and connect it each time we want to login a user to spotify and get a token, right?

And then again, how would we refresh all these tokens?

Sorry for not being technical, I'm a founder who needs an alternative solution ASAP (Spotify api keys verification takes > 6 weeks, if they approve it at all these days)

Thanks

I'm talking about this https://miro.medium.com/max/1400/1*FsxbEkRZGb2wiiKYILkWpQ.png

OAuth2 dialogue I think...

Can we use HTTP API of librespot-java for this?
we would use librespot only for official authentication of the user... nothing else.. the rest is handled by our own app
malesh
@ivanmales_twitter
if this is possible, i'd be more than happy to pay someone to develop this solution and show it to my developers. thanks for your attention
malesh
@ivanmales_twitter
...and yes this dialogue would have to be shown to the end-user etc,,, just so you guys don't think we're trying to do something shady or whatever... i can explain more in private after i sign someone on with an NDA or similar..
Michael Herger
@michaelherger
Are you looking for something similar like this discussion? https://github.com/librespot-org/librespot/discussions/882
malesh
@ivanmales_twitter

Hi " I went the other way around: I'm using librespot to get the token, which I then use to access the web API. It's much simpler, as I didn't have to implement the auth flow. "

I would need to use auth flow i think
I want to use auth flow - so the user gets official login dialogue

malesh
@ivanmales_twitter
Basically the idea is to use Librespot to authenticate the user properly, the proper official way.
Jason Gray
@JasonLG1979
@ivanmales_twitter stop spamming this chat. No one is going to sign an NDA just to hold your hand. We're about open collaboration here. Everything you want to do is documented by Spotify. You don't need libresot (or really much of anything) to do what you want. Go though the proper channels get the keys and hire a developer if you don't know what you're doing.
Jason Gray
@JasonLG1979
@ivanmales_twitter I just tried and had no problem getting api keys instantly. I don't know what that 6 week B.S. is about?
Sasha Hilton
@sashahilton00
@ivanmales_twitter I’m not sure librespot is what you are looking for - if you’re looking to build a commercial product for interaction with Spotify, you probably don’t want to bank on their goodwill allowing you to unofficially interact with their services via something like librespot - it’s not really been written with that in mind, and won’t have the reliability/stability of official SDKs. On a second note, I’m not sure what you are asking about wrt the Web auth dialog and also using librespot to login - it’s doesn’t really work like that. The web auth dialog is a consent screen for app authentication. Librespot is more like a hardware device in terms of how it appears to Spotify, and just so happens to have a means to retrieve auth tokens due to some services needing them, and even then, we’ve noticed discrepancies between the tokens issued to librespot vs web apps in terms of where and how they can be used.
malesh
@ivanmales_twitter
@JasonLG1979
Screen Shot 2021-12-01 at 12.50.06 AM.png
Sasha Hilton
@sashahilton00
Spotify have issued you with the Client ID & Client Secret though?
so what’s the problem
malesh
@ivanmales_twitter
@sashahilton00
Screen Shot 2021-11-28 at 11.17.14 AM.png
@sashahilton00 up to 25 users, and you need to enter their usernames in the dash...
Sasha Hilton
@sashahilton00
ok, but you haven’t written the app yet, so 25 users shouldn’t be an issue? If you have a few devs and 10 testers you’re still well below the limit
then whilst you’re writing the app you can apply and get the restriction lifted
malesh
@ivanmales_twitter
eh
Sasha Hilton
@sashahilton00
anyhow, i’m not really sure how this concerns librespot anymore. I suggest you contact Spotify dev support if you have queries around their app restrictions as realistically no one here can do anything about it
malesh
@ivanmales_twitter
i can't get into details.
you can figure out by what i asked that i'm not a pirater or whatnot.
in any case tnx for the help
(Y)
Jason Gray
@JasonLG1979

@ivanmales_twitter You actually have to write an app and submit it for approval before you can go to "Extended Quota Mode". The whole idea is that you develop your app in "Development mode" and then when you have at least a working demo you submit it to Spotify for their approval. Again kinda makes me think that you're trying to skip the approval process because you know that what you want to do would never get approval. Because if you were trying to make a legit commercial app you'd want and need approval.

https://developer.spotify.com/community/news/2021/05/27/improving-the-developer-and-user-experience-for-third-party-apps/

Michael Herger
@michaelherger
To be fair I can confirm from experience that dealing with Spotify even with a commercial agreement in place can be a bit tedious... But this indeed has nothing to do with librespot.
Nick Steel
@kingosticks
Agreed, it is tedious but I've always gotten there in the end (which is better than other big companies!). I found things have improved there in the last couple of years after they hired a developer relations person. They might even have two of them now. If you have a problem you need to highlight it to those guys to step in. But you need to actually have a legit problem first I.e. had a reasonable app request rejected or waited the specified time. Good luck.
JP Hastings-Spital
@jphastings
Hey folks! It's there any documentation on the different events which get sent to the program in the --onevent argument? I'm particularly looking to get the cover of the song playing when it starts, but can't seem to find any docs for this.
2 replies
malesh
@ivanmales_twitter

Agreed, it is tedious but I've always gotten there in the end (which is better than other big companies!). I found things have improved there in the last couple of years after they hired a developer relations person. They might even have two of them now. If you have a problem you need to highlight it to those guys to step in. But you need to actually have a legit problem first I.e. had a reasonable app request rejected or waited the specified time. Good luck.

thank you, that was very helpful.

dubo-dubon-duponey
@dubo-dubon-duponey
@jphastings I’m using stopped started and changed. This script here is retrieving the covert art and pushing it on a framebuffer: https://github.com/dubo-dubon-duponey/docker-spotify/blob/master/context/runtime/boot/onevent.sh - feel free to take what you need from there / adapt (MIT)
Jason Gray
@JasonLG1979
@jphastings I was also playing around with the onevent stuff and something like this (which is untested and may need tweaked) might work to translate the events to a fifo:
#!/usr/bin/python3
import os
import json

fifo_path = "/path/to/your/fifo"

try:
    os.mkfifo(fifo_path, 0o666)
except FileExistsError:
    # That's Ok...
    pass

except PermissionError as e:
    # You don't have permission to create a file in that location...
    print("PermissionError: {}".format(e))
    pass

except Exception as e:
    # Handle this...
    print(e)
    pass

json_dict = None

if os.getenv('PLAYER_EVENT') == 'changed':
    json_dict = {
        'event': os.getenv('PLAYER_EVENT'),
        'old_track_id': os.getenv('OLD_TRACK_ID') || "",
        'new_track_id': os.getenv('TRACK_ID') || ""
    }

elif os.getenv('PLAYER_EVENT') in ('started', 'stopped', 'preloading'):
    json_dict = {
        'event': os.getenv('PLAYER_EVENT'),
        'track_id': os.getenv('TRACK_ID') || ""
    }

elif os.getenv('PLAYER_EVENT') in ('playing', 'paused'):
    json_dict = {
        'event': os.getenv('PLAYER_EVENT'),
        'track_id': os.getenv('TRACK_ID') || "",
        'duration_ms': os.getenv('DURATION_MS') || "0",
        'position_ms': os.getenv('POSITION_MS') || "0"
    }

elif os.getenv('PLAYER_EVENT') == 'volume_set':
    json_dict = {
        'event': os.getenv('PLAYER_EVENT'),
        'volume': os.getenv('VOLUME') || "0"
    }

if json_dict:
   print(json_dict)
   with open(fifo_path, 'w') as f:
        try:
            json.dump(json_dict, f)
        except Exception as e:
            # Handle this...
            print(e)
            pass
Once you get everything worked out I'd remove the print statements as they'll leak into librespot's stdout.
Jason Gray
@JasonLG1979
Derp replace "||" with "or" it's been a while since I wrote some python,lol!!!