this was painful

main
aiden 11 months ago
commit d093ac5c53

@ -0,0 +1,2 @@
# scdl
it's gonna be a firefox browser extension that allows you to download playing soundcloud songs

@ -0,0 +1,28 @@
function scdl() {
if (typeof scdl.c == "undefined") {
scdl.c = 0n;
}
let key = "scdl" + Math.floor(Math.random() * 0x100000000).toString(0x10).padStart(8, "0") + scdl.c++;
let fuck = true;
webpackJsonp.push([[], { [key]: function (_, __, r) {
if (fuck) {
fuck = false;
return;
}
let player = r(17).getCurrentSound().player.player._player._controllerManager._cacheManager._players.find(e => e._playlistSegmentRetriever != null);
if (!player) {
return alert("Play a song.");
}
let segments = player._playlistSegmentRetriever._segments;
if (player._playlist._data.segments.length != segments.length) {
return alert("Song not fully downloaded yet.");
}
let u8_arrays = [];
let completed = 0;
for (let idx = 0; idx < segments.length; ++idx) {
u8_arrays.push(segments[idx].dataRetrieveJob._jobControl.progressUpdates.getProgressSoFar().data);
}
alert("issa " + player._transmuxerAndMimeType.mimeType);
location = URL.createObjectURL(new Blob(u8_arrays, { type: "application/octet-stream" }));
} }, [[key]]]);
}
Loading…
Cancel
Save