add yt lyrics

This commit is contained in:
vapormusic 2021-12-24 13:20:57 +07:00
parent 9fb4585e52
commit 0486fb8fa6
3 changed files with 137 additions and 62 deletions

View file

@ -7,6 +7,7 @@ const windowStateKeeper = require("electron-window-state");
const os = require('os');
const Store = require("electron-store");
const store = new Store();
const yt = require('youtube-search-without-api-key');
const schema = {
"general": {
@ -183,6 +184,12 @@ const CiderBase = {
win.close();
})
ipcMain.handle('getYTLyrics', async (event, track, artist) => {
var u = track + " " + artist + " official video";
const videos = await yt.search(u);
return videos
})
ipcMain.handle('getStoreValue', (event, key, defaultValue) => {
return (defaultValue ? app.cfg.get(key, true) : app.cfg.get(key));
});