mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 02:31:45 +00:00
Add first version for crossfade plugin
This commit is contained in:
13
plugins/crossfade/back.js
Normal file
13
plugins/crossfade/back.js
Normal file
@ -0,0 +1,13 @@
|
||||
const { ipcMain } = require("electron");
|
||||
const { Innertube } = require("youtubei.js");
|
||||
|
||||
module.exports = async (win, options) => {
|
||||
const yt = await Innertube.create();
|
||||
|
||||
ipcMain.handle("audio-url", async (_, videoID) => {
|
||||
const info = await yt.getBasicInfo(videoID);
|
||||
const url = info.streaming_data?.formats[0].decipher(yt.session.player);
|
||||
|
||||
return url;
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user