From 5144faa1f99664354c1d9894d271b84c1946b190 Mon Sep 17 00:00:00 2001 From: absidue <48293849+absidue@users.noreply.github.com> Date: Mon, 25 Nov 2024 19:10:01 +0100 Subject: [PATCH] Fix incompatibility with upcoming YouTube.js version --- src/renderer/helpers/api/local.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/renderer/helpers/api/local.js b/src/renderer/helpers/api/local.js index 94f24537359e7..43a163e33989c 100644 --- a/src/renderer/helpers/api/local.js +++ b/src/renderer/helpers/api/local.js @@ -1,4 +1,4 @@ -import { ClientType, Endpoints, Innertube, Misc, Parser, UniversalCache, Utils, YT, YTNodes } from 'youtubei.js' +import { ClientType, Innertube, Misc, Parser, UniversalCache, Utils, YT, YTNodes } from 'youtubei.js' import Autolinker from 'autolinker' import { SEARCH_CHAR_LIMIT } from '../../../constants' @@ -365,12 +365,12 @@ export async function getLocalChannelVideos(id) { const innertube = await createInnertube() try { - const response = await innertube.actions.execute(Endpoints.BrowseEndpoint.PATH, Endpoints.BrowseEndpoint.build({ - browse_id: id, + const response = await innertube.actions.execute('/browse', { + browseId: id, params: 'EgZ2aWRlb3PyBgQKAjoA' // protobuf for the videos tab (this is the one that YouTube uses, // it has some empty fields in the protobuf but it doesn't work if you remove them) - })) + }) const videosTab = new YT.Channel(null, response) const { id: channelId = id, name, thumbnailUrl } = parseLocalChannelHeader(videosTab, true) @@ -422,12 +422,12 @@ export async function getLocalChannelLiveStreams(id) { const innertube = await createInnertube() try { - const response = await innertube.actions.execute(Endpoints.BrowseEndpoint.PATH, Endpoints.BrowseEndpoint.build({ - browse_id: id, + const response = await innertube.actions.execute('/browse', { + browseId: id, params: 'EgdzdHJlYW1z8gYECgJ6AA%3D%3D' // protobuf for the live tab (this is the one that YouTube uses, // it has some empty fields in the protobuf but it doesn't work if you remove them) - })) + }) let liveStreamsTab = new YT.Channel(innertube.actions, response) const { id: channelId = id, name, thumbnailUrl } = parseLocalChannelHeader(liveStreamsTab, true) @@ -470,12 +470,12 @@ export async function getLocalChannelCommunity(id) { const innertube = await createInnertube() try { - const response = await innertube.actions.execute(Endpoints.BrowseEndpoint.PATH, Endpoints.BrowseEndpoint.build({ - browse_id: id, + const response = await innertube.actions.execute('/browse', { + browseId: id, params: 'Egljb21tdW5pdHnyBgQKAkoA' // protobuf for the community tab (this is the one that YouTube uses, // it has some empty fields in the protobuf but it doesn't work if you remove them) - })) + }) const communityTab = new YT.Channel(null, response)