Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Commit

Permalink
fix(innertube): Fixed low speed of playing video (#669)
Browse files Browse the repository at this point in the history
  • Loading branch information
pixkk authored Nov 15, 2023
1 parent 043779d commit 2e063e2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions NUXT/plugins/innertube.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ class Innertube {
}

if (isMatch) {
console.log("The input string matches the regex pattern.");
const firstPart = isMatch[0].substring(1);

if (
Expand Down Expand Up @@ -124,13 +123,14 @@ class Innertube {
//.get("n"))&&(b=fG[0](b),a.set("n",b),fG.length||kq(""))}}
// fG;
challenge_name = new RegExp(
`var ${challenge_name}\\s*=\\s*\\[(.+?)\\]\\s*[,;]`
`var ${challenge_name.replace("$", "\\$")}\\s*=\\s*\\[(.+?)\\]\\s*[,;]`
).exec(baseJs.data)[1];
challenge_name = new RegExp(
`${challenge_name}\\s*=\\s*function\\s*\\(([\\w$]+)\\)\\s*{(.+?}\\s*return\\ [\\w$]+.join\\(""\\))};`,
"s"
).exec(baseJs.data)[2];
const fullCode = "var getN=function(a){" + challenge_name + "}; return getN;";
const fullCode =
"var getN=function(a){" + challenge_name + "}; return getN;";
let getN = new Function(fullCode);
this.nfunction = getN();
}
Expand All @@ -143,6 +143,8 @@ class Innertube {
const baseJsUrl =
constants.URLS.YT_MOBILE +
getBetweenStrings(html.data, '"jsUrl":"', '","');
// const baseJsUrl =
// "https://m.youtube.com//s//player//5bdfe6d5//player-plasma-ias-tablet-ru_RU.vflset//base.js";
// Get base.js content
const baseJs = await Http.get({
url: baseJsUrl,
Expand Down

0 comments on commit 2e063e2

Please sign in to comment.