add more debugging, add fallback for low quality audio not existing
This commit is contained in:
parent
76e8c9c2d4
commit
e448db5cd0
|
@ -125,7 +125,7 @@ export async function createSabrStream(
|
||||||
}> {
|
}> {
|
||||||
const innertube = await Innertube.create({ cache: new UniversalCache(true) });
|
const innertube = await Innertube.create({ cache: new UniversalCache(true) });
|
||||||
const webPoTokenResult = await generateWebPoToken(innertube.session.context.client.visitorData || '');
|
const webPoTokenResult = await generateWebPoToken(innertube.session.context.client.visitorData || '');
|
||||||
console.log(`debugging -> ${JSON.stringify(webPoTokenResult)}`)
|
console.log(`debugging -> ${JSON.stringify(webPoTokenResult)}, ${videoId}`)
|
||||||
|
|
||||||
// Get video metadata.
|
// Get video metadata.
|
||||||
const playerResponse = await makePlayerRequest(innertube, videoId);
|
const playerResponse = await makePlayerRequest(innertube, videoId);
|
||||||
|
@ -145,6 +145,10 @@ export async function createSabrStream(
|
||||||
return true
|
return true
|
||||||
})
|
})
|
||||||
.map(buildSabrFormat) || [];
|
.map(buildSabrFormat) || [];
|
||||||
|
|
||||||
|
if (!sabrFormats.find(f => f.audioQuality == 'AUDIO_QUALITY_LOW')) { // there is no low quality, we go medium
|
||||||
|
options.audioQuality = 'AUDIO_QUALITY_MEDIUM'
|
||||||
|
}
|
||||||
|
|
||||||
const serverAbrStream = new SabrStream({
|
const serverAbrStream = new SabrStream({
|
||||||
formats: sabrFormats,
|
formats: sabrFormats,
|
||||||
|
|
Loading…
Reference in New Issue