Add check for streaming data

This commit is contained in:
WardPearce
2026-02-13 16:23:35 +13:00
parent 3fadc71fff
commit 3d624e77a3
2 changed files with 5 additions and 3 deletions
+4 -1
View File
@@ -84,10 +84,13 @@ export async function getVideoYTjs(videoId: string): Promise<VideoPlay> {
// Unsupported format fix
// https://github.com/LuanRT/googlevideo/issues/42
if (video.streaming_data)
if (video.streaming_data) {
video.streaming_data.adaptive_formats = video.streaming_data.adaptive_formats.filter(
(format) => format.xtags !== 'CgcKAnZiEgEx'
);
} else {
throw new Error('Video did not provide streaming data.');
}
const adaptiveFormats: AdaptiveFormats[] = [];
video.streaming_data?.adaptive_formats.forEach((format) => {
@@ -56,6 +56,7 @@
});
completed = displayContent.continuation === newContent.continuation;
displayContent.continuation = newContent.continuation;
}
if ('videos' in newContent && 'videos' in displayContent) {
@@ -75,8 +76,6 @@
displayContent.playlists = [...displayContent.playlists, ...newContent.playlists];
}
displayContent.continuation = newContent.continuation;
}
async function changeTab(newTab: 'videos' | 'playlists' | 'streams' | 'shorts') {