Skip to content

Commit

Permalink
Merge pull request #62 from gatecrasher777/2.5.3
Browse files Browse the repository at this point in the history
2.5.3
  • Loading branch information
gatecrasher777 authored Sep 29, 2024
2 parents 68f6a66 + 3080cad commit ce82416
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions lib/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,14 @@ class Player extends Model {

// extracts n parameter encoding function
extractNCode() {
let fname = ut.pinch(this.data, '&&(b=a.get("n"))&&(b=', '(b)', 0, 0, '', false);
if (fname.indexOf('[') !== -1) {
fname = ut.pinch(this.data, `var ${fname.split('[')[0]}=[`, ']', 0, 0, '', false);
const alphanum = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTVUWXYZ.$_0123456789';
let ffunc, nstart = 0, fname = '', clue = code.indexOf('enhanced_except');
clue < 0 && (clue = code.indexOf('String.prototype.split.call(a,"")'));
clue < 0 && (clue = code.indexOf('Array.prototype.join.call(b,"")'));
clue > 0 && (nstart = code.lastIndexOf('=function(a){', clue) - 1);
while (nstart && alphanum.includes(code.charAt(nstart))) {
fname = code.charAt(nstart) + fname;
nstart--;
}
let ffunc = `${fname}=function(a)`;
ffunc = `var ${ut.traverse(this.data, ffunc)}`;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ytcog",
"version": "2.5.2",
"version": "2.5.3",
"description": "YouTube innertube class library for node-js; session, player, searches, channels, playlists, videos and downloads.",
"main": "./lib/index.js",
"repository": {
Expand Down

0 comments on commit ce82416

Please sign in to comment.