fix: resolves #978

This commit is contained in:
JellyBrick
2023-09-13 22:52:06 +09:00
parent ad8b9c9bf7
commit 7d355ea1f2
2 changed files with 4 additions and 8 deletions

View File

@ -153,7 +153,6 @@
"html-to-text": "9.0.5",
"keyboardevent-from-electron-accelerator": "2.0.0",
"keyboardevents-areequal": "0.2.2",
"md5": "2.3.0",
"mpris-service": "2.1.2",
"node-id3": "0.2.6",
"simple-youtube-age-restriction-bypass": "git+https://github.com/MiepHD/Simple-YouTube-Age-Restriction-Bypass.git#v2.5.5",
@ -173,7 +172,6 @@
"@types/electron-localshortcut": "^3.1.0",
"@types/howler": "^2.2.8",
"@types/html-to-text": "^9.0.1",
"@types/md5": "^2.3.2",
"@types/youtube-player": "^5.5.7",
"@typescript-eslint/eslint-plugin": "6.7.0",
"auto-changelog": "2.4.0",

View File

@ -1,5 +1,6 @@
import crypto from 'node:crypto';
import { BrowserWindow, net, shell } from 'electron';
import md5 from 'md5';
import { setOptions } from '../../config/plugins';
import registerCallback, { SongInfo } from '../../providers/song-info';
@ -37,10 +38,7 @@ const createQueryString = (parameters: Record<string, unknown>, apiSignature: st
const createApiSig = (parameters: Record<string, unknown>, secret: string) => {
// This function creates the api signature, see: https://www.last.fm/api/authspec
const keys = [];
for (const key in parameters) {
keys.push(key);
}
const keys = Object.keys(parameters);
keys.sort();
let sig = '';
@ -53,7 +51,7 @@ const createApiSig = (parameters: Record<string, unknown>, secret: string) => {
}
sig += secret;
sig = md5(sig);
sig = crypto.createHash('md5').update(sig, 'utf-8').digest('hex');
return sig;
};