4 ms·
Protip: librespot doesn't actually require premium Just modify the authentication code in https://github.com/librespot-org/librespot-golang/blob/master/libresp
by costco 3y ago
Protip: librespot doesn't actually require premium
Just modify the authentication code in https://github.com/librespot-org/librespot-golang/blob/master/librespot/core/login.go#L181 https://github.com/librespot-org/librespot-golang/blob/maste... to look something like this:
packet := &Spotify.ClientResponseEncrypted{
LoginCredentials: &Spotify.LoginCredentials{
Username: proto.String(username),
Typ: authType,
AuthData: authData,
},
AccountCreation: Spotify.AccountCreation_ACCOUNT_CREATION_ALWAYS_PROMPT.Enum(),
SystemInfo: &Spotify.SystemInfo{
CpuFamily: Spotify.CpuFamily_CPU_X86_64.Enum(),
CpuSubtype: proto.Uint32(0),
Brand: Spotify.Brand_BRAND_UNBRANDED.Enum(),
BrandFlags: proto.Uint32(0),
Os: Spotify.Os_OS_LINUX.Enum(),
OsVersion: proto.Uint32(0),
OsExt: proto.Uint32(0),
SystemInformationString: proto.String("Linux [x86-64 0]"),
DeviceId: proto.String("libspotify"),
},
PlatformModel: proto.String("PC desktop"),
VersionString: ...,
ClientInfo: &Spotify.ClientInfo{
Limited: proto.Bool(false),
Language: proto.String("en"),
},
}
In the go version of the library they set some boolean in the request that makes it not work with free accounts but if you change it to this it will work. You can also use this Wireshark dissector to read Spotify protobuf messages directly: https://github.com/plietar/spotify-analyze/blob/master/dissect/protobuf_dissector/README.md https://github.com/plietar/spotify-analyze/blob/master/disse...
Then you can make the authentication packet look exactly like the desktop client (though this is not required because Spotify has lax validation).
- deleted 3y ago[deleted]