mirror of
https://github.com/GladistonXD/votify-fix.git
synced 2026-04-26 15:05:58 +03:00
[GH-ISSUE #12] What does the websocket code do in this context? #11
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/votify-fix#11
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 @cynthia2006 on GitHub (Feb 26, 2026).
Original GitHub issue: https://github.com/GladistonXD/votify-fix/issues/12
Looking at the current code the purpose of
websocketsseems rather unclear, because the API works fine without it?@GladistonXD commented on GitHub (Feb 26, 2026):
It doesn't work, you get an IP ban. The socket is necessary to simulate playing the music and for the server to know that it's possibly a real user. If you remove that, you can't download more than 28 songs.
@GladistonXD commented on GitHub (Feb 26, 2026):
I put that separation there precisely to indicate that from there upwards it's solely for simulating play, and the decryption problem might even be some websocket-based function that hasn't been identified yet.
github.com/GladistonXD/votify-fix@bcb13b81a2/votify/spotify_api.py (L401)@cynthia2006 commented on GitHub (Feb 26, 2026):
Really? But I've downloaded over 100 songs in one go.
@GladistonXD commented on GitHub (Feb 26, 2026):
Without sending that put request? lol, mine freezes after 27 songs, without sending a put request to the server, the only exception is if the account is open and running in the background:
github.com/GladistonXD/votify-fix@bcb13b81a2/votify/spotify_api.py (L328)@cynthia2006 commented on GitHub (Feb 26, 2026):
Inspecting DevTools, there appears to be a single WebSocket connection, which is the one you're controlling in your code. And, the decryption issue seems to be on a per-account basis; not someting related to a particular kind of CDM per se.
Apparently, I'm getting this error.Even though the CDM is closed after use 🤷♀️Ah, it was my bad.
@cynthia2006 commented on GitHub (Feb 26, 2026):
Well, I'm taking a shortcut here: I'm not using the pathfinder API for downloading tracks, just the track playback API.
@GladistonXD commented on GitHub (Feb 26, 2026):
The following PUT sequences exist:
/state PUT
seq_num: 2
debug_source: "before_track_load"
seq_num: 3
debug_source: "speed_changed"
seq_num: 4
debug_source: "speed_changed"
playback_speed: 1
seq_num: 5
debug_source: "started_playing" < ===== I use this in the request.
seq_num: 5
debug_source: "track_data_finalized"
next song:
seq_num: 6
debug_source: "before_track_load"
Each time the music plays, the number continues the sequence.
I noticed that there is a
debug_source: "track_data_finalizedstatement; perhaps this is what identifies it, as it doesn't send a finished song PUT to the server. I'll test it later.@cynthia2006 commented on GitHub (Feb 26, 2026):
The best bet is to see how album downloads work in the official Spotify client.
@GladistonXD commented on GitHub (Feb 26, 2026):
Yes, analyzing the Spotify program for offline music would resolve the doubts, but I believe the program uses some kind of encryption and its own format to play music offline; they divide it into parts like \Spotify\Data\00\00c62b9d1a8bd34c9a3db769118470b455cdf910.file
Converting that into an audible format would be a challenge.
@cynthia2006 commented on GitHub (Feb 26, 2026):
00c62b9d1a8bd34c9a3db769118470b455cdf910is stored in00folder because of easier lookup, and is probably just the CENC-encrypted MP4 file. However, I specifically want to analyse what network requests it makes to mass download licenses.By the way, I've noticed this additional PUT sequence.
And, the
track_data_finalizedsequence is indeed sent when the song ends. I've also noticed that a seek (to the end) generates this PUT request.And, it's preceeded by a
speed_changerequest. So the most natural, non-invasive sequences are in order:before_track_load→speed_changed→speed_changed (playback_speed = 1)→played_threshold_reached→track_data_finalizedbefore_track_load→speed_changed→speed_changed (playback_speed = 1)→speed_changed (playback_speed = 0)→position_changed (position = duration)→track_data_finalizedbefore_track_load→speed_changed→speed_changed (playback_speed = 1)→track_data_finalized@GladistonXD commented on GitHub (Feb 26, 2026):
This quota limit might be for renewing license request quotas, but it's impossible to know for sure:
played_threshold_reachedI don't have time to test it right now.
@cynthia2006 commented on GitHub (Feb 26, 2026):
How funny, they don't even use Widevine in the official client; they use Playplay through and through. I've used mitmproxy to record a log of HTTP requests, and it seems that only the Widevine endpoint is restricted. I'm not sure if Playplay is only available to premium users.
@GladistonXD commented on GitHub (Feb 27, 2026):
I imagined it would be a different system; I think the easiest thing would be to understand the reverse engineering of the Android application, which is easier to manipulate.
@cynthia2006 commented on GitHub (Feb 27, 2026):
They probably use Widevine, because it's readily available on Android, or they might use Playplay. Unfortunately, I've never worked with Android development, so I don't have any experience on how to decompile it (because it must've been obfuscated somehow).
@GladistonXD commented on GitHub (Feb 27, 2026):
Is this Playplay the Microsoft PlayReady? If so, it's used on Windows systems, I don't think it will be used on Android, and an easier way to analyze Spotify web is via embed, it gives cleaner outputs:
https://open.spotify.com/embed/track/18gqCQzqYb0zvurQPlRkpoIf the problem is "track_data_finalized", this request will be a lot of work.
@cynthia2006 commented on GitHub (Feb 27, 2026):
No, it's not Microsoft's PlayReady, because then it wouldn't be used on Linux. I'm using ArchLinux here. Playplay is Spotify's own DRM. And, in the Votify code it seems as if it's just AES-CTR.
@cynthia2006 commented on GitHub (Feb 27, 2026):
@GladistonXD Okay, so I've confirmed it now. These motherfolkers use Playplay on Android too.
@GladistonXD commented on GitHub (Feb 27, 2026):
When DRM is less well-known, it's usually easier to crack, but reverse engineering Java is tricky.
@cynthia2006 commented on GitHub (Feb 27, 2026):
Playplay has been cracked, but Spotify DMCA's any repo on Github; it's available on various other sites (use DuckDuckGo).
@cynthia2006 commented on GitHub (Feb 27, 2026):
Honestly, instead of all this fuss it's just better to use YouTube Music, which has superior audio quality anyway (not protected by DRM) 🤷♀️
Besides, Anna's Archive has scraped the entire Spotify anyway; so it's just wait until they release it.
@GladistonXD commented on GitHub (Feb 27, 2026):
Lol, there's this site that downloads Apple Music without an account too.
https://t2tunes.site/
But I use Spotify because of the playlists, someday when I have time I'll find a solution, even if I have to use Selenium for it.
@cynthia2006 commented on GitHub (Feb 28, 2026):
That's great :)
In the meantime, we could perhaps study librespot and adapt it to fit our needs. It has all the procedures in place, and it won't take much effort to port it to use free accounts.That project is close to dead; it doesn't work for me. And yes, I'm using a premium account.
@cynthia2006 commented on GitHub (Feb 28, 2026):
However, in that scenario it might potentially get banned off of Github; so we have to move somewhere else.Apparently, unplayplay doesn't work anymore or perhaps they've changed the IV of AES or maybe Glomatico's code (in Votify) is plain wrong? Either way, it's impossible to tell unless the official client reverse engineered. I don't know how to, thus Widevine remains as the only option.