From ece381d2ca2aa066277a172181b1ad32d59e2708 Mon Sep 17 00:00:00 2001 From: uh wot Date: Mon, 19 Jul 2021 20:24:32 +0200 Subject: [PATCH] welp, flac's ded lol --- README.md | 2 +- dzunlock.user.js | 38 +++++--------------------------------- 2 files changed, 6 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 10efd7c..61a5f01 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # dzunlock -enables deezer hifi features lol +enables deezer premium features lol # how 2 install diff --git a/dzunlock.user.js b/dzunlock.user.js index fdf0179..3ffec9f 100644 --- a/dzunlock.user.js +++ b/dzunlock.user.js @@ -3,7 +3,7 @@ // @namespace io.github.uhwot.dzunlock // @description enables deezer hifi features lol // @author uh wot -// @version 1.2.3 +// @version 1.2.4 // @license GPL-3.0-only // @homepageURL https://git.freezer.life/uhwot/dzunlock // @downloadURL https://git.freezer.life/uhwot/dzunlock/raw/branch/master/dzunlock.user.js @@ -87,11 +87,6 @@ fetchIntercept = { const clientId = '119915' const clientSecret = '2f5b4c9785ddc367975b83d90dc46f5c' -const formats = [ - { api: '320', gw: 'MP3_320' }, - { api: 'flac', gw: 'FLAC' } -] - async function renewAccessToken() { let url = `https://connect.deezer.com/oauth/access_token.php?grant_type=client_credentials&client_id=${clientId}&client_secret=${clientSecret}&output=json` let resp = await fetch(url) @@ -155,9 +150,7 @@ window.addEventListener('DOMContentLoaded', (_) => { userUppedSoFar++ continue } - for (let j = 0; j < formats.length; j++) { - data.data[i]['FILESIZE_' + formats[j].gw] = json.batch_result[i - userUppedSoFar]['filesize_' + formats[j].api] - } + data.data[i].FILESIZE_MP3_320 = json.batch_result[i - userUppedSoFar].filesize_320 // for streaming while unlogged data.data[i].MD5_ORIGIN = json.batch_result[i - userUppedSoFar].md5_origin } @@ -213,38 +206,17 @@ fetchIntercept.register({ } }); -worker_input = function(e) { +worker_input = function (e) { let json = e.data if (typeof json !== 'object') { json = JSON.parse(json) } //console.log("input", json) input = json - - if (json.message.md5) { - // track url gen - - // decrypted track endpoint - json.message.cdn = 'https://cdns-proxy-{0}.dzcdn.net/api/1/' - worker.postMessage(JSON.stringify(json)) - return - } - if (json.message.buffer) { - // track buffer decryption - // this code skips decryption entirely, since the track from the CDN is already unencrypted - - let out = { message: { error: undefined } } - out['Symbol(PromisingWorker.id)'] = json['Symbol(PromisingWorker.id)'] - out.message.result = json.message.buffer - //console.log("track buffer output", out) - postMessage(out) - return - } - worker.postMessage(e.data) } -worker_output = function(e) { +worker_output = function (e) { let json = e.data if (typeof json !== 'object') { json = JSON.parse(json) @@ -255,7 +227,7 @@ worker_output = function(e) { // player token decryption // enables 320/flac quality selection - json.message.result.audio_qualities.wifi_streaming = ['low', 'standard', 'high', 'lossless'] + json.message.result.audio_qualities.wifi_streaming = ['low', 'standard', 'high'] // disables previews json.message.result.streaming = true json.message.result.limited = false