mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 18:41:47 +00:00
12 lines
339 B
TypeScript
12 lines
339 B
TypeScript
import { ipcMain } from 'electron';
|
|
import { Innertube } from 'youtubei.js';
|
|
|
|
export default async () => {
|
|
const yt = await Innertube.create();
|
|
|
|
ipcMain.handle('audio-url', async (_, videoID: string) => {
|
|
const info = await yt.getBasicInfo(videoID);
|
|
return info.streaming_data?.formats[0].decipher(yt.session.player);
|
|
});
|
|
};
|