Minor performance improvement
This commit is contained in:
parent
ff0129d9db
commit
5f993c4c0b
@ -128,7 +128,7 @@ export class YouTubePlayList {
|
|||||||
async next(limit = Infinity): Promise<YouTubeVideo[]> {
|
async next(limit = Infinity): Promise<YouTubeVideo[]> {
|
||||||
if (!this._continuation || !this._continuation.token) return [];
|
if (!this._continuation || !this._continuation.token) return [];
|
||||||
|
|
||||||
const nextPage = await request(`${BASE_API}${this._continuation.api}`, {
|
const nextPage = await request(`${BASE_API}${this._continuation.api}&prettyPrint=false`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
continuation: this._continuation.token,
|
continuation: this._continuation.token,
|
||||||
|
|||||||
@ -609,7 +609,7 @@ async function acceptViewerDiscretion(
|
|||||||
if (!sessionToken)
|
if (!sessionToken)
|
||||||
throw new Error(`Unable to extract XSRF_TOKEN to accept the viewer discretion popup for video: ${videoId}.`);
|
throw new Error(`Unable to extract XSRF_TOKEN to accept the viewer discretion popup for video: ${videoId}.`);
|
||||||
|
|
||||||
const verificationResponse = await request(`https://www.youtube.com/youtubei/v1/verify_age?key=${apiKey}`, {
|
const verificationResponse = await request(`https://www.youtube.com/youtubei/v1/verify_age?key=${apiKey}&prettyPrint=false`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
context: {
|
context: {
|
||||||
@ -683,7 +683,7 @@ async function getAndroidFormats(videoId: string, cookieJar: { [key: string]: st
|
|||||||
body.split('innertubeApiKey":"')[1]?.split('"')[0] ??
|
body.split('innertubeApiKey":"')[1]?.split('"')[0] ??
|
||||||
DEFAULT_API_KEY;
|
DEFAULT_API_KEY;
|
||||||
|
|
||||||
const response = await request(`https://www.youtube.com/youtubei/v1/player?key=${apiKey}`, {
|
const response = await request(`https://www.youtube.com/youtubei/v1/player?key=${apiKey}&prettyPrint=false`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
context: {
|
context: {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user