From a0ac9b65d401893ff82fce6f744ce6dac540a9a2 Mon Sep 17 00:00:00 2001 From: SrIzan10 Date: Thu, 24 Jun 2021 19:18:41 +0200 Subject: [PATCH] info.js --- info.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/info.js b/info.js index a2dd09a..f361f84 100644 --- a/info.js +++ b/info.js @@ -60,8 +60,8 @@ exports.getBasicInfo = async(id, options) => { }; let info = await pipeline([id, options], validate, retryOptions, [ getWatchHTMLPage, - getWatchJSONPage, - getVideoInfoPage, + //getWatchJSONPage, + //getVideoInfoPage, ]); Object.assign(info, { @@ -251,7 +251,7 @@ const parseJSON = (source, varName, json) => { const findJSON = (source, varName, body, left, right, prependJSON) => { - let jsonStr = utils.between(body, left, right); + let jsonStr = body.split("ytInitialPlayerResponse = {")[1].split("}}};")[0] += "}}}"; if (!jsonStr) { throw Error(`Could not find ${varName} in ${source}`); } @@ -325,8 +325,6 @@ const VIDEO_EURL = 'https://youtube.googleapis.com/v/'; const getVideoInfoPage = async(id, options) => { const url = new URL(`https://${INFO_HOST}${INFO_PATH}`); url.searchParams.set('video_id', id); - url.searchParams.set('c', 'TVHTML5'); - url.searchParams.set('cver', '7.20190319'); url.searchParams.set('eurl', VIDEO_EURL + id); url.searchParams.set('ps', 'default'); url.searchParams.set('gl', 'US');