fix(sabr): Video-only playback is no longer supported

What a bummer...

At least they can't remove audio-only, since it's still needed for YouTube Music. :)
This commit is contained in:
Luan
2024-10-24 09:12:18 -03:00
parent 5cec3e9b5f
commit 3ab569c637
3 changed files with 10 additions and 15 deletions

View File

@@ -3,7 +3,7 @@ import cliProgress from 'cli-progress';
import type { WriteStream } from 'node:fs';
import { createWriteStream, unlink } from 'node:fs';
import { Innertube, UniversalCache } from 'youtubei.js';
import GoogleVideo, { type Format, Protos } from '../../dist/src/index.js';
import GoogleVideo, { type Format } from '../../dist/src/index.js';
const progressBars = new cliProgress.MultiBar({
stopOnComplete: true,
@@ -121,8 +121,8 @@ await serverAbrStream.init({
audioFormats: [ selectedAudioFormat ],
videoFormats: [ selectedVideoFormat ],
clientAbrState: {
mediaType: Protos.MediaType.MEDIA_TYPE_DEFAULT,
startTimeMs: 0
startTimeMs: 0,
mediaType: 0 // 0 = BOTH, 1 = AUDIO (video-only is no longer supported by YouTube)
}
});

View File

@@ -2,7 +2,7 @@ import cliProgress from 'cli-progress';
import type { WriteStream } from 'node:fs';
import { createWriteStream } from 'node:fs';
import { Innertube, UniversalCache } from 'youtubei.js';
import GoogleVideo, { type Format, Protos } from '../../dist/src/index.js';
import GoogleVideo, { type Format } from '../../dist/src/index.js';
const progressBars = new cliProgress.MultiBar({
stopOnComplete: true,
@@ -130,13 +130,8 @@ await serverAbrStream.init({
audioFormats: [ selectedAudioFormat ],
videoFormats: [ selectedVideoFormat ],
clientAbrState: {
/**
* MEDIA_TYPE_DEFAULT = 0,
* MEDIA_TYPE_AUDIO = 1,
* MEDIA_TYPE_VIDEO = 2,
*/
mediaType: Protos.MediaType.MEDIA_TYPE_DEFAULT,
startTimeMs: 0
startTimeMs: 0,
mediaType: 0 // 0 = BOTH, 1 = AUDIO (video-only is no longer supported by YouTube)
}
});