This commit is contained in:
SrIzan10
2021-06-24 19:18:41 +02:00
parent 4fe7102096
commit a0ac9b65d4

View File

@@ -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');