diff --git a/package.json b/package.json index a3cb0fc5..3ca92f5e 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/plugins/last-fm/back.ts b/plugins/last-fm/back.ts index a307b87c..e5826356 100644 --- a/plugins/last-fm/back.ts +++ b/plugins/last-fm/back.ts @@ -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, apiSignature: st const createApiSig = (parameters: Record, 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, secret: string) => { } sig += secret; - sig = md5(sig); + sig = crypto.createHash('md5').update(sig, 'utf-8').digest('hex'); return sig; };