mirror of
https://github.com/kokarare1212/librespot-python.git
synced 2026-04-25 08:35:49 +03:00
[GH-ISSUE #116] [REQUEST] Token generation documentation #13
Labels
No labels
bug
dependencies
duplicate
enhancement
invalid
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot-python-kokarare1212#13
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @sa7mon on GitHub (Feb 17, 2022).
Original GitHub issue: https://github.com/kokarare1212/librespot-python/issues/116
Is your feature request related to a problem? Please describe.
Not really a problem, just wondering if there could be some documentation on how the process works to take the credentials and generate a token from them.
Describe the solution you'd like
I'm working on a Golang app that has a component which needs to query Show info from Spotify. The auth schemes offered by libraries like zmb3/spotify assume the app is a web app and the user will interact with it - this is not the case with my CLI app.
Your library is the best one I've found so far to just take usename+password and generate a valid token for the API. Since my app is in Go, I was hoping to implement a purely Go solution but am struggling to follow the flow through this library.
Anything you can provide about how the process generally works would be greatly appreciated. I understand the library needs to hit 3 different apresolve endpoints - I can see that in the network traffic - but after that I'm a bit lost. I know Protobuf is involved, but not sure how.
Describe alternatives you've considered
If I have to, I could shell out and run a simple Python script using this library to get the token, but I'd really like to avoid that if possible.
Additional context
Thanks for the great library!
@kokarare1212 commented on GitHub (Feb 18, 2022):
ApResolver's accesspoint is used to connect to a tcp socket.
After an internal key exchange, the user is authenticated with a username and password.
The token is obtained by using a special protocol called hm.
https://github.com/kokarare1212/librespot-python/blob/rewrite/librespot/mercury.py#L303-L308
Also, the source code of this repository is not well organized, so it may be easier to refer to the original repository.
https://github.com/librespot-org/librespot-java
@sa7mon commented on GitHub (Feb 19, 2022):
Thanks, this helps
On Thu, Feb 17, 2022 at 6:11 PM, 碧舞 すみほ @.***> wrote: