mirror of
https://github.com/SrIzan10/mainwebsite.git
synced 2026-06-06 00:56:58 +00:00
info.js
This commit is contained in:
8
info.js
8
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');
|
||||
|
||||
Reference in New Issue
Block a user