Skip to content

Commit

Permalink
fix: fixed N function extraction.
Browse files Browse the repository at this point in the history
  • Loading branch information
pixkk committed Jan 12, 2025
1 parent 7a18c5c commit a1251ac
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions NUXT/plugins/innertube.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//⚠️🚧 WARNING: THIS FILE IS IN MAINTENANCE MODE 🚧⚠️
// DO NOT ADD NEW FEATURES TO THIS FILE. INNERTUBE.JS IS NOW A SEPARATE LIBRARY
// contribute to the library here: https://github.com/VueTubeApp/Vuetube-Extractor
// NEW FEATURES FROM THIS FILE WILL BE TRASFERRED TO INNERTUBE.JS - A SEPARATE LIBRARY
// New library: https://github.com/pixkk/Vuetube-Extractor (currently is not active)

// Code specific to working with the innertube API
// https://www.youtube.com/youtubei/v1
Expand Down Expand Up @@ -87,12 +87,20 @@ class Innertube {
} else if (/\{a=a\.split\(""[^"]*""\)\};/i.exec(baseJs.data)) {
// 10.07.2023
isMatch = /\{a=a\.split\(""[^"]*""\)\};/i.exec(baseJs.data);
} else {
} else if (/\{a=a\.split\(""\);[A-z0-9$]+\.[A-Za-z0-9]+\([^)]*\);[A-z0-9$]+\.[A-Za-z0-9]+\([^)]*\);[A-z0-9$]+\.[A-Za-z0-9]+\([^)]*\);[A-z0-9$]+\.[A-Za-z0-9]+\([^)]*\);[A-z0-9$]+\.[A-Za-z0-9]+\([^)]*\);return a\.join\(""\)\};/.exec(
baseJs.data
)){
isMatch =
/\{a=a\.split\(""\);[A-z0-9$]+\.[A-Za-z0-9]+\([^)]*\);[A-z0-9$]+\.[A-Za-z0-9]+\([^)]*\);[A-z0-9$]+\.[A-Za-z0-9]+\([^)]*\);[A-z0-9$]+\.[A-Za-z0-9]+\([^)]*\);[A-z0-9$]+\.[A-Za-z0-9]+\([^)]*\);return a\.join\(""\)\};/.exec(
baseJs.data
);
}
else {
// 12.01.2025
isMatch = /\{[A-Za-z$]=[A-z0-9$]\.split\(""\);[A-z0-9$]+\.[A-Za-z0-9]+\([^)]*\);[A-z0-9$]+\.[A-Za-z0-9]+\([^)]*\);[A-z0-9$]+\.[A-Za-z0-9]+\([^)]*\);[A-z0-9$]+\.[A-Za-z0-9]+\([^)]*\);return +[A-z0-9$]\.join\(""\)};/.exec(
baseJs.data
);
}
if (!isMatch) {
console.warn(
"The second part of decipher string does not match the regex pattern."
Expand Down

0 comments on commit a1251ac

Please sign in to comment.