LuanRT / YouTube.js

A wrapper around YouTube's internal API — reverse engineering InnerTube
https://www.npmjs.com/package/youtubei.js
MIT License
3.46k stars 217 forks source link

no update to video+audio for higher resolution? #665

Open ryznxx opened 2 months ago

ryznxx commented 2 months ago

Question

High resolution and audio?

maybe i ask same question but im curious i already read docs


const info = await yt.getBasicInfo('somevideoid');

const url = info.streaming_data?.formats[0].decipher(yt.session.player);
console.info('Playback url:', url);

// or:
const format = info.chooseFormat({ type: 'video+audio', quality: 'best' });
const url = format?.decipher(yt.session.player);
console.info('Playback url:', url);

Other details

No response

Checklist

absidue commented 2 months ago

YouTube doesn't provide any streams like that, you will have to download an audio stream and a video stream from the adaptive_formats array and then combine them with a tool like ffmpeg.

ryznxx commented 2 months ago

YouTube doesn't provide any streams like that, you will have to download an audio stream and a video stream from the adaptive_formats array and then combine them with a tool like ffmpeg.

i dont think it works when run it on vercel

gmagreti commented 1 month ago

O YouTube não fornece nenhum fluxo desse tipo. Você terá que baixar um fluxo de áudio e um fluxo de vídeo do adaptive_formatsarray e então combiná-los com uma ferramenta como o ffmpeg.

não acho que funcione quando executado no vercel

Have you already tried doing this?