god dammit, filter out the fucking ai dubs

This commit is contained in:
localhost 2025-08-02 00:07:51 +03:00
parent f1927b465c
commit 0a2bf432a1
1 changed files with 11 additions and 1 deletions

View File

@ -137,7 +137,17 @@ export async function createSabrStream(
if (!videoPlaybackUstreamerConfig) throw new Error('ustreamerConfig not found');
if (!serverAbrStreamingUrl) throw new Error('serverAbrStreamingUrl not found');
const sabrFormats = playerResponse.streaming_data?.adaptive_formats.map(buildSabrFormat) || [];
const sabrFormats = playerResponse.streaming_data?.adaptive_formats
.filter(f => {
if (f.has_audio) { // this is an audio track, we need to filter out the ai dubs
if (f.is_auto_dubbed) return false
if (!f.audio_track?.audio_is_default) return false
if (!f.audio_track.display_name.endsWith('original')) return false
}
return true
})
.map(buildSabrFormat) || [];
const serverAbrStream = new SabrStream({
formats: sabrFormats,