fix for tampermonkey/greasemonkey
This commit is contained in:
parent
a46482057a
commit
de585b2ff8
|
@ -3,7 +3,7 @@
|
||||||
// @namespace io.github.uhwot.dzunlock
|
// @namespace io.github.uhwot.dzunlock
|
||||||
// @description enables deezer hifi features lol
|
// @description enables deezer hifi features lol
|
||||||
// @author uh wot
|
// @author uh wot
|
||||||
// @version 1.1.4
|
// @version 1.1.5
|
||||||
// @license GPL-3.0-only
|
// @license GPL-3.0-only
|
||||||
// @homepageURL https://git.freezer.life/uhwot/dzunlock
|
// @homepageURL https://git.freezer.life/uhwot/dzunlock
|
||||||
// @downloadURL https://git.freezer.life/uhwot/dzunlock/raw/branch/master/dzunlock.user.js
|
// @downloadURL https://git.freezer.life/uhwot/dzunlock/raw/branch/master/dzunlock.user.js
|
||||||
|
@ -15,6 +15,7 @@
|
||||||
// @require https://cdnjs.cloudflare.com/ajax/libs/aes-js/3.1.2/index.min.js
|
// @require https://cdnjs.cloudflare.com/ajax/libs/aes-js/3.1.2/index.min.js
|
||||||
// @grant GM_getValue
|
// @grant GM_getValue
|
||||||
// @grant GM_setValue
|
// @grant GM_setValue
|
||||||
|
// @run-at document-start
|
||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
|
|
||||||
const debug = false
|
const debug = false
|
||||||
|
@ -89,8 +90,8 @@ const clientSecret = '2f5b4c9785ddc367975b83d90dc46f5c'
|
||||||
const playerTokenKey = [102, 228, 95, 242, 215, 50, 122, 26, 57, 216, 206, 38, 164, 237, 200, 85]
|
const playerTokenKey = [102, 228, 95, 242, 215, 50, 122, 26, 57, 216, 206, 38, 164, 237, 200, 85]
|
||||||
|
|
||||||
const formats = [
|
const formats = [
|
||||||
{api: '320', gw: 'MP3_320'},
|
{ api: '320', gw: 'MP3_320' },
|
||||||
{api: 'flac', gw: 'FLAC'}
|
{ api: 'flac', gw: 'FLAC' }
|
||||||
]
|
]
|
||||||
|
|
||||||
function str2bin(str) {
|
function str2bin(str) {
|
||||||
|
@ -140,7 +141,8 @@ async function renewAccessToken() {
|
||||||
return access_token
|
return access_token
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafeWindow.dzPlayer.setTrackList = (function (old) {
|
window.addEventListener('DOMContentLoaded', (_) => {
|
||||||
|
unsafeWindow.dzPlayer.setTrackList = (function (old) {
|
||||||
return async function (...args) {
|
return async function (...args) {
|
||||||
// don't get filesizes if account is hifi
|
// don't get filesizes if account is hifi
|
||||||
if (unsafeWindow.dzPlayer.user_status.lossless) {
|
if (unsafeWindow.dzPlayer.user_status.lossless) {
|
||||||
|
@ -199,7 +201,8 @@ unsafeWindow.dzPlayer.setTrackList = (function (old) {
|
||||||
|
|
||||||
return old(...args)
|
return old(...args)
|
||||||
};
|
};
|
||||||
})(unsafeWindow.dzPlayer.setTrackList);
|
})(unsafeWindow.dzPlayer.setTrackList);
|
||||||
|
});
|
||||||
|
|
||||||
fetchIntercept.register({
|
fetchIntercept.register({
|
||||||
request: function (url, config) {
|
request: function (url, config) {
|
||||||
|
|
Loading…
Reference in New Issue