Skip to content

Commit 25f115e

Browse files
committed
SABR fallback to DASH
1 parent 98feb10 commit 25f115e

File tree

3 files changed

+276
-39
lines changed

3 files changed

+276
-39
lines changed

src/renderer/helpers/api/local.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ export async function getLocalSearchContinuation(continuationData) {
197197
/**
198198
* @param {string} id
199199
* @returns {Promise<{
200-
* info: YT.VideoInfo,
200+
* info: import('youtubei.js').YT.VideoInfo,
201201
* poToken: string | undefined,
202202
* clientInfo: {
203203
* clientName: number,
@@ -233,6 +233,14 @@ export async function getLocalVideoInfo(id) {
233233

234234
const info = await webInnertube.getInfo(id)
235235

236+
// temporary workaround for SABR-only responses
237+
const mwebInfo = await webInnertube.getBasicInfo(id, 'MWEB')
238+
239+
if (mwebInfo.playability_status.status === 'OK' && mwebInfo.streaming_data?.adaptive_formats) {
240+
info.playability_status = mwebInfo.playability_status
241+
info.streaming_data.adaptive_formats = mwebInfo.streaming_data.adaptive_formats
242+
}
243+
236244
let { clientName, clientVersion, osName, osVersion } = webInnertube.session.context.client
237245

238246
let hasTrailer = info.has_trailer

0 commit comments

Comments
 (0)