mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 18:41:47 +00:00
fix: resolves #978
This commit is contained in:
@ -153,7 +153,6 @@
|
|||||||
"html-to-text": "9.0.5",
|
"html-to-text": "9.0.5",
|
||||||
"keyboardevent-from-electron-accelerator": "2.0.0",
|
"keyboardevent-from-electron-accelerator": "2.0.0",
|
||||||
"keyboardevents-areequal": "0.2.2",
|
"keyboardevents-areequal": "0.2.2",
|
||||||
"md5": "2.3.0",
|
|
||||||
"mpris-service": "2.1.2",
|
"mpris-service": "2.1.2",
|
||||||
"node-id3": "0.2.6",
|
"node-id3": "0.2.6",
|
||||||
"simple-youtube-age-restriction-bypass": "git+https://github.com/MiepHD/Simple-YouTube-Age-Restriction-Bypass.git#v2.5.5",
|
"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/electron-localshortcut": "^3.1.0",
|
||||||
"@types/howler": "^2.2.8",
|
"@types/howler": "^2.2.8",
|
||||||
"@types/html-to-text": "^9.0.1",
|
"@types/html-to-text": "^9.0.1",
|
||||||
"@types/md5": "^2.3.2",
|
|
||||||
"@types/youtube-player": "^5.5.7",
|
"@types/youtube-player": "^5.5.7",
|
||||||
"@typescript-eslint/eslint-plugin": "6.7.0",
|
"@typescript-eslint/eslint-plugin": "6.7.0",
|
||||||
"auto-changelog": "2.4.0",
|
"auto-changelog": "2.4.0",
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
|
import crypto from 'node:crypto';
|
||||||
|
|
||||||
import { BrowserWindow, net, shell } from 'electron';
|
import { BrowserWindow, net, shell } from 'electron';
|
||||||
import md5 from 'md5';
|
|
||||||
|
|
||||||
import { setOptions } from '../../config/plugins';
|
import { setOptions } from '../../config/plugins';
|
||||||
import registerCallback, { SongInfo } from '../../providers/song-info';
|
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) => {
|
const createApiSig = (parameters: Record<string, unknown>, secret: string) => {
|
||||||
// This function creates the api signature, see: https://www.last.fm/api/authspec
|
// This function creates the api signature, see: https://www.last.fm/api/authspec
|
||||||
const keys = [];
|
const keys = Object.keys(parameters);
|
||||||
for (const key in parameters) {
|
|
||||||
keys.push(key);
|
|
||||||
}
|
|
||||||
|
|
||||||
keys.sort();
|
keys.sort();
|
||||||
let sig = '';
|
let sig = '';
|
||||||
@ -53,7 +51,7 @@ const createApiSig = (parameters: Record<string, unknown>, secret: string) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sig += secret;
|
sig += secret;
|
||||||
sig = md5(sig);
|
sig = crypto.createHash('md5').update(sig, 'utf-8').digest('hex');
|
||||||
return sig;
|
return sig;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user