Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
commit
c72de35534
4 changed files with 59 additions and 15 deletions
|
@ -37,7 +37,7 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@sentry/electron": "^3.0.7",
|
"@sentry/electron": "^3.0.7",
|
||||||
"@sentry/integrations": "^6.19.6",
|
"@sentry/integrations": "^6.19.6",
|
||||||
"adm-zip": "0.5.9",
|
"adm-zip": "0.4.10",
|
||||||
"castv2-client": "^1.2.0",
|
"castv2-client": "^1.2.0",
|
||||||
"chokidar": "^3.5.3",
|
"chokidar": "^3.5.3",
|
||||||
"discord-rpc": "^4.0.1",
|
"discord-rpc": "^4.0.1",
|
||||||
|
|
|
@ -645,6 +645,35 @@ export class BrowserWindow {
|
||||||
* ipcMain Events
|
* ipcMain Events
|
||||||
****************************************************************************************************************** */
|
****************************************************************************************************************** */
|
||||||
|
|
||||||
|
ipcMain.handle("mkv3", async (event, args) => {
|
||||||
|
const options = {
|
||||||
|
route: "",
|
||||||
|
token: "",
|
||||||
|
mediaToken: "",
|
||||||
|
GETBody: {}
|
||||||
|
}
|
||||||
|
Object.assign(options, args);
|
||||||
|
|
||||||
|
let res = await fetch(
|
||||||
|
`https://amp-api.music.apple.com/${options.route}?${new URLSearchParams({
|
||||||
|
...options.GETBody
|
||||||
|
}).toString()}`,
|
||||||
|
{
|
||||||
|
method: "GET",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
authorization: `Bearer ${options.token}`,
|
||||||
|
path: options.route,
|
||||||
|
authority: "amp-api.music.apple.com",
|
||||||
|
"media-user-token": options.mediaToken,
|
||||||
|
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Cider/1.4.2 Chrome/100.0.4896.75 Electron/18.0.3 Safari/537.36"
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
|
let json = await res.json();
|
||||||
|
return json;
|
||||||
|
})
|
||||||
|
|
||||||
ipcMain.on("get-wallpaper", async (event) => {
|
ipcMain.on("get-wallpaper", async (event) => {
|
||||||
const wpPath: string = await wallpaper.get();
|
const wpPath: string = await wallpaper.get();
|
||||||
// get the wallpaper and encode it to base64 then return
|
// get the wallpaper and encode it to base64 then return
|
||||||
|
|
|
@ -50,12 +50,13 @@ app.on('ready', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
console.log('[Cider][Widevine] Status:', components.status());
|
console.log('[Cider][Widevine] Status:', components.status());
|
||||||
win.show();
|
|
||||||
|
|
||||||
win.on("ready-to-show", () => {
|
win.on("ready-to-show", () => {
|
||||||
Cider.bwCreated();
|
Cider.bwCreated();
|
||||||
console.debug('[Cider] Window is Ready.')
|
console.debug('[Cider] Window is Ready.')
|
||||||
CiderPlug.callPlugins('onReady', win);
|
CiderPlug.callPlugins('onReady', win);
|
||||||
|
win.show();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,27 @@
|
||||||
const MusicKitTools = {
|
const MusicKitTools = {
|
||||||
|
async v3Backend({
|
||||||
|
route = "", getBody = {}, options = {}
|
||||||
|
}) {
|
||||||
|
return await (await ipcRenderer.invoke("mkv3", {
|
||||||
|
token: MusicKit.getInstance().developerToken,
|
||||||
|
route: route,
|
||||||
|
mediaToken: MusicKit.getInstance().musicUserToken,
|
||||||
|
GETBody: getBody
|
||||||
|
}))
|
||||||
|
},
|
||||||
async v3Continuous({
|
async v3Continuous({
|
||||||
href,
|
href,
|
||||||
options = {},
|
options = {},
|
||||||
reqOptions = {},
|
reqOptions = {},
|
||||||
onProgress = () => {},
|
onProgress = () => {
|
||||||
onError = () => {},
|
},
|
||||||
onSuccess = () => {}
|
onError = () => {
|
||||||
|
},
|
||||||
|
onSuccess = () => {
|
||||||
|
}
|
||||||
} = {}) {
|
} = {}) {
|
||||||
let returnData = []
|
let returnData = []
|
||||||
|
|
||||||
async function sendReq(href, options) {
|
async function sendReq(href, options) {
|
||||||
const response = await app.mk.api.v3.music(href, options).catch(error => onError)
|
const response = await app.mk.api.v3.music(href, options).catch(error => onError)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue