mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 00:05:55 +03:00
[GH-ISSUE #152] Support saving audio files #111
Labels
No labels
A-Alsa
SpotifyAPI
Tokio 1.0
audio
bug
can't reproduce
compilation
dependencies
duplicate
enhancement
good first issue
help wanted
high priority
imported
imported
invalid
new api
pull-request
question
reverse engineering
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot#111
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 @paulo-raca on GitHub (Feb 14, 2018).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/152
On my spotify-based application, I don't want to just playback the live audio stream, but also to fetch it for offline playback later.
So... Question 1, how do you fell about adding a
fetch_audio_filemethod to the library, and what would be the best way to implement it?I have hacked a simple patch to do so: https://github.com/paulo-raca/librespot/pull/278/commits/a83f355535cf679262e89261b65522d45a4195e3
It basically splits the flow of
load_trackin half:This works perfectly for Ogg Vorbis files, but not at all for other formats:
OTHER2fetches a file successfully, but appears to be garbage (Maybe it has a different decryption scheme? Maybe I just have no idea what is the file format?)Question 2, Has there been any investigation on the decryption of those files? (I'm mainly interested in AAC or FLAC
@kingosticks commented on GitHub (Feb 14, 2018):
Part 1 would be a blatant violation of Spotify's end user agreement and cannot be endorsed or supported. This sort of functionality makes the project a target for being shut down. There is no place for this in librespot. This issue should be closed to make that clear. If there is still merit in question 2 (maybe some tracks do not provide ogg data?) it should be in new separate issue.
@sashahilton00 commented on GitHub (Feb 14, 2018):
Hi,
This is unfortunately outside the scope of this project, as offline playback is something that Spotify has only supported in their clients. Since libspotify did not include this functionality, and a number of projects that used libspotify in this way, essentially as an audio ripper, we will not be adding such functionality as it could put the future of the project at risk. Librespot is heavily focused on being a connect receiver anyway, which requires a connection to the internet at all times. Whilst here are a couple of bugs, such as not handling reconnection at the time of writing, if you need to listen to music, it should be whilst librespot is online, and providing the audio in realtime.
@paulo-raca commented on GitHub (Feb 14, 2018):
Got it, thanks!
@plietar commented on GitHub (Feb 14, 2018):
While having a save audio file feature is not something we want to expose directly, I'm fine with supporting offline playback as long as it goes through the existing Player/Sink architecture. This won't make ripping any easier than current librespot.
@paulo-raca what's your use case for offline playback? Would my proposal be enough for you?
This would require both #134 and #22 to be implemented. We don't have any cache eviction at the moment (#34), but if we do we'll want to have a way of pinning certain tracks.
This may have been true initially, but with libspotify finally going away there are new potential use cases for librespot outside of connect.
@paulo-raca commented on GitHub (Feb 14, 2018):
I have a bluetooth speaker that I take everywhere and I currently use it tethered to my phone.
But there are a few (minor) issues on this setup:
A small device with librespot could do it all, except I would like it to continue working without internet connection.
My initial plan was to attach a tiny linux computer (fruit-pi) that would sync up a playlist when the internet is available and just play the cached songs forever over the speaker -- As you can see, I managed to do that, but your suggestion for built-in support on librespot would be even better.
@Zocker1999NET commented on GitHub (Mar 1, 2020):
I do not know if it is possible to follow my propose but what do you think about a solution similar to the official implementation of the Linux client: Store the music files still encrypted but also store the keys "semi-encrypted" and remove the keys after a certain time not having refreshed them OR only store the music so the library only requires internet for getting the keys. This can be just as helpful as the official client, at least in countries with expensive cellular connections (like Germany 🎉) or bad connections, and should be conform to the end user agreements (if reverse-engineering the API was permitted by national laws you have to obey).
@aniketfuryrocks commented on GitHub (Sep 16, 2021):
can we implement a proxy cache ?
@roderickvd commented on GitHub (Sep 16, 2021):
What do you want it to do, other than the proxy support and caching support that is already in?
As for saving files locally, please refer to https://github.com/librespot-org/librespot/issues/152#issuecomment-365600191: that's not something we want to support because we don't want to violate the Spotify T&C's.