Add check for streaming data
This commit is contained in:
@@ -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') {
|
||||
|
||||
Reference in New Issue
Block a user