0
0
Fork 0
mirror of https://github.com/VueTubeApp/VueTube synced 2024-11-01 01:12:39 +00:00

Merge pull request #183 from 404-Program-not-found/main

fix: api key not provided in /next calls
This commit is contained in:
Kenny 2022-03-24 17:26:42 -04:00 committed by GitHub
commit d58fb60e61
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -98,7 +98,7 @@ class Innertube {
async getVidAsync(id) { async getVidAsync(id) {
let data = { context: this.context, videoId: id }; let data = { context: this.context, videoId: id };
const responseNext = await Http.post({ const responseNext = await Http.post({
url: `${constants.URLS.YT_BASE_API}/next?v=${id}`, url: `${constants.URLS.YT_BASE_API}/next?key=${this.key}`,
data: data, data: data,
headers: constants.INNERTUBE_HEADER(this.context.client), headers: constants.INNERTUBE_HEADER(this.context.client),
}).catch((error) => error); }).catch((error) => error);
@ -181,11 +181,9 @@ class Innertube {
response.data.output?.playabilityStatus?.status == ("ERROR" || undefined) response.data.output?.playabilityStatus?.status == ("ERROR" || undefined)
) )
throw new Error( throw new Error(
`Could not get information for video: ${ `Could not get information for video: ${response.status_code ||
response.status_code ||
response.data.output?.playabilityStatus?.status response.data.output?.playabilityStatus?.status
} - ${ } - ${response.message || response.data.output?.playabilityStatus?.reason
response.message || response.data.output?.playabilityStatus?.reason
}` }`
); );
const responseInfo = response.data.output; const responseInfo = response.data.output;