companion ip

This commit is contained in:
localhost 2026-01-17 23:43:42 +01:00
parent 520b1c455a
commit 0bedddc21f
1 changed files with 4 additions and 2 deletions

View File

@ -164,7 +164,8 @@ export async function downloadStream(streamUrl: string, format: any, stream: Wri
}
async function getStreamUrl(videoId: string, itag: number): Promise<string|false> {
const req = await fetch(`http://127.0.0.1:8282/companion/latest_version?id=${videoId}&itag=${itag}`, {
const config = await Bun.file('config.json').json()
const req = await fetch(`http://${config.companionIp || '127.0.0.1'}:8282/companion/latest_version?id=${videoId}&itag=${itag}`, {
redirect: 'manual'
})
@ -183,7 +184,8 @@ function secondsToTime(seconds: number) {
}
export async function getInfo(videoId: string) {
const req = await fetch('http://127.0.0.1:8282/companion/youtubei/v1/player', {
const config = await Bun.file('config.json').json()
const req = await fetch(`http://${config.companionIp || '127.0.0.1'}:8282/companion/youtubei/v1/player`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',