mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-26 16:18:51 +00:00
refactor(Player)!: Use AST-based JS extraction with side-effect safe code emission (#1052)
* chore(deps): Add `meriyah` * feat(utils): Implement AST-based JS extractors * chore(utils): Remove old ast walker code * fix(Player): Migrate js extraction logic * chore(JsExtractor): Fix typo in tsdoc * perf(JsAnalyzer): Simplify main AST analysis logic * fix(JsAnalyzer): Change `break` to `return` in AST matching logic * chore: Update docs * chore: Don't export `PlayerInitializationOptions` * chore(evaluate): Update error message to include doc link * perf: Use a `for-loop` to find iife
This commit is contained in:
@@ -16,4 +16,4 @@
|
||||
|
||||
## Defined in
|
||||
|
||||
[src/parser/parser.ts:217](https://github.com/LuanRT/YouTube.js/blob/4ae0cc5c523a2080e68d6c0c1437c78fe318ea30/src/parser/parser.ts#L217)
|
||||
[src/parser/parser.ts:218](https://github.com/LuanRT/YouTube.js/blob/af92984523f90200a18314b94478a2697c9deab0/src/parser/parser.ts#L218)
|
||||
|
||||
@@ -16,4 +16,4 @@
|
||||
|
||||
## Defined in
|
||||
|
||||
[src/parser/parser.ts:824](https://github.com/LuanRT/YouTube.js/blob/4ae0cc5c523a2080e68d6c0c1437c78fe318ea30/src/parser/parser.ts#L824)
|
||||
[src/parser/parser.ts:825](https://github.com/LuanRT/YouTube.js/blob/af92984523f90200a18314b94478a2697c9deab0/src/parser/parser.ts#L825)
|
||||
|
||||
@@ -16,4 +16,4 @@
|
||||
|
||||
## Defined in
|
||||
|
||||
[src/parser/parser.ts:770](https://github.com/LuanRT/YouTube.js/blob/4ae0cc5c523a2080e68d6c0c1437c78fe318ea30/src/parser/parser.ts#L770)
|
||||
[src/parser/parser.ts:771](https://github.com/LuanRT/YouTube.js/blob/af92984523f90200a18314b94478a2697c9deab0/src/parser/parser.ts#L771)
|
||||
|
||||
@@ -10,4 +10,4 @@
|
||||
|
||||
## Defined in
|
||||
|
||||
[src/parser/parser.ts:222](https://github.com/LuanRT/YouTube.js/blob/4ae0cc5c523a2080e68d6c0c1437c78fe318ea30/src/parser/parser.ts#L222)
|
||||
[src/parser/parser.ts:223](https://github.com/LuanRT/YouTube.js/blob/af92984523f90200a18314b94478a2697c9deab0/src/parser/parser.ts#L223)
|
||||
|
||||
@@ -14,4 +14,4 @@
|
||||
|
||||
## Defined in
|
||||
|
||||
[src/parser/parser.ts:201](https://github.com/LuanRT/YouTube.js/blob/4ae0cc5c523a2080e68d6c0c1437c78fe318ea30/src/parser/parser.ts#L201)
|
||||
[src/parser/parser.ts:202](https://github.com/LuanRT/YouTube.js/blob/af92984523f90200a18314b94478a2697c9deab0/src/parser/parser.ts#L202)
|
||||
|
||||
@@ -14,4 +14,4 @@
|
||||
|
||||
## Defined in
|
||||
|
||||
[src/parser/parser.ts:213](https://github.com/LuanRT/YouTube.js/blob/4ae0cc5c523a2080e68d6c0c1437c78fe318ea30/src/parser/parser.ts#L213)
|
||||
[src/parser/parser.ts:214](https://github.com/LuanRT/YouTube.js/blob/af92984523f90200a18314b94478a2697c9deab0/src/parser/parser.ts#L214)
|
||||
|
||||
@@ -34,7 +34,7 @@ YTNode types that are allowed to be parsed.
|
||||
|
||||
### Defined in
|
||||
|
||||
[src/parser/parser.ts:627](https://github.com/LuanRT/YouTube.js/blob/4ae0cc5c523a2080e68d6c0c1437c78fe318ea30/src/parser/parser.ts#L627)
|
||||
[src/parser/parser.ts:628](https://github.com/LuanRT/YouTube.js/blob/af92984523f90200a18314b94478a2697c9deab0/src/parser/parser.ts#L628)
|
||||
|
||||
## parse(data, requireArray, validTypes)
|
||||
|
||||
@@ -60,7 +60,7 @@ YTNode types that are allowed to be parsed.
|
||||
|
||||
### Defined in
|
||||
|
||||
[src/parser/parser.ts:628](https://github.com/LuanRT/YouTube.js/blob/4ae0cc5c523a2080e68d6c0c1437c78fe318ea30/src/parser/parser.ts#L628)
|
||||
[src/parser/parser.ts:629](https://github.com/LuanRT/YouTube.js/blob/af92984523f90200a18314b94478a2697c9deab0/src/parser/parser.ts#L629)
|
||||
|
||||
## parse(data, requireArray, validTypes)
|
||||
|
||||
@@ -84,4 +84,4 @@ YTNode types that are allowed to be parsed.
|
||||
|
||||
### Defined in
|
||||
|
||||
[src/parser/parser.ts:629](https://github.com/LuanRT/YouTube.js/blob/4ae0cc5c523a2080e68d6c0c1437c78fe318ea30/src/parser/parser.ts#L629)
|
||||
[src/parser/parser.ts:630](https://github.com/LuanRT/YouTube.js/blob/af92984523f90200a18314b94478a2697c9deab0/src/parser/parser.ts#L630)
|
||||
|
||||
@@ -14,4 +14,4 @@
|
||||
|
||||
## Defined in
|
||||
|
||||
[src/parser/parser.ts:756](https://github.com/LuanRT/YouTube.js/blob/4ae0cc5c523a2080e68d6c0c1437c78fe318ea30/src/parser/parser.ts#L756)
|
||||
[src/parser/parser.ts:757](https://github.com/LuanRT/YouTube.js/blob/af92984523f90200a18314b94478a2697c9deab0/src/parser/parser.ts#L757)
|
||||
|
||||
@@ -30,7 +30,7 @@ YTNode types that are allowed to be parsed.
|
||||
|
||||
### Defined in
|
||||
|
||||
[src/parser/parser.ts:600](https://github.com/LuanRT/YouTube.js/blob/4ae0cc5c523a2080e68d6c0c1437c78fe318ea30/src/parser/parser.ts#L600)
|
||||
[src/parser/parser.ts:601](https://github.com/LuanRT/YouTube.js/blob/af92984523f90200a18314b94478a2697c9deab0/src/parser/parser.ts#L601)
|
||||
|
||||
## parseArray(data, validType)
|
||||
|
||||
@@ -52,7 +52,7 @@ YTNode types that are allowed to be parsed.
|
||||
|
||||
### Defined in
|
||||
|
||||
[src/parser/parser.ts:601](https://github.com/LuanRT/YouTube.js/blob/4ae0cc5c523a2080e68d6c0c1437c78fe318ea30/src/parser/parser.ts#L601)
|
||||
[src/parser/parser.ts:602](https://github.com/LuanRT/YouTube.js/blob/af92984523f90200a18314b94478a2697c9deab0/src/parser/parser.ts#L602)
|
||||
|
||||
## parseArray(data)
|
||||
|
||||
@@ -68,4 +68,4 @@ YTNode types that are allowed to be parsed.
|
||||
|
||||
### Defined in
|
||||
|
||||
[src/parser/parser.ts:602](https://github.com/LuanRT/YouTube.js/blob/4ae0cc5c523a2080e68d6c0c1437c78fe318ea30/src/parser/parser.ts#L602)
|
||||
[src/parser/parser.ts:603](https://github.com/LuanRT/YouTube.js/blob/af92984523f90200a18314b94478a2697c9deab0/src/parser/parser.ts#L603)
|
||||
|
||||
@@ -14,4 +14,4 @@
|
||||
|
||||
## Defined in
|
||||
|
||||
[src/parser/parser.ts:714](https://github.com/LuanRT/YouTube.js/blob/4ae0cc5c523a2080e68d6c0c1437c78fe318ea30/src/parser/parser.ts#L714)
|
||||
[src/parser/parser.ts:715](https://github.com/LuanRT/YouTube.js/blob/af92984523f90200a18314b94478a2697c9deab0/src/parser/parser.ts#L715)
|
||||
|
||||
@@ -20,4 +20,4 @@ A YTNode instance if parsing is successful, undefined otherwise
|
||||
|
||||
## Defined in
|
||||
|
||||
[src/parser/parser.ts:662](https://github.com/LuanRT/YouTube.js/blob/4ae0cc5c523a2080e68d6c0c1437c78fe318ea30/src/parser/parser.ts#L662)
|
||||
[src/parser/parser.ts:663](https://github.com/LuanRT/YouTube.js/blob/af92984523f90200a18314b94478a2697c9deab0/src/parser/parser.ts#L663)
|
||||
|
||||
@@ -20,4 +20,4 @@ An observed array of parsed YTNodes
|
||||
|
||||
## Defined in
|
||||
|
||||
[src/parser/parser.ts:698](https://github.com/LuanRT/YouTube.js/blob/4ae0cc5c523a2080e68d6c0c1437c78fe318ea30/src/parser/parser.ts#L698)
|
||||
[src/parser/parser.ts:699](https://github.com/LuanRT/YouTube.js/blob/af92984523f90200a18314b94478a2697c9deab0/src/parser/parser.ts#L699)
|
||||
|
||||
@@ -16,4 +16,4 @@
|
||||
|
||||
## Defined in
|
||||
|
||||
[src/parser/parser.ts:766](https://github.com/LuanRT/YouTube.js/blob/4ae0cc5c523a2080e68d6c0c1437c78fe318ea30/src/parser/parser.ts#L766)
|
||||
[src/parser/parser.ts:767](https://github.com/LuanRT/YouTube.js/blob/af92984523f90200a18314b94478a2697c9deab0/src/parser/parser.ts#L767)
|
||||
|
||||
@@ -30,7 +30,7 @@ YTNode types that are allowed to be parsed.
|
||||
|
||||
### Defined in
|
||||
|
||||
[src/parser/parser.ts:534](https://github.com/LuanRT/YouTube.js/blob/4ae0cc5c523a2080e68d6c0c1437c78fe318ea30/src/parser/parser.ts#L534)
|
||||
[src/parser/parser.ts:535](https://github.com/LuanRT/YouTube.js/blob/af92984523f90200a18314b94478a2697c9deab0/src/parser/parser.ts#L535)
|
||||
|
||||
## parseItem(data, validTypes)
|
||||
|
||||
@@ -52,7 +52,7 @@ YTNode types that are allowed to be parsed.
|
||||
|
||||
### Defined in
|
||||
|
||||
[src/parser/parser.ts:535](https://github.com/LuanRT/YouTube.js/blob/4ae0cc5c523a2080e68d6c0c1437c78fe318ea30/src/parser/parser.ts#L535)
|
||||
[src/parser/parser.ts:536](https://github.com/LuanRT/YouTube.js/blob/af92984523f90200a18314b94478a2697c9deab0/src/parser/parser.ts#L536)
|
||||
|
||||
## parseItem(data)
|
||||
|
||||
@@ -68,4 +68,4 @@ YTNode types that are allowed to be parsed.
|
||||
|
||||
### Defined in
|
||||
|
||||
[src/parser/parser.ts:536](https://github.com/LuanRT/YouTube.js/blob/4ae0cc5c523a2080e68d6c0c1437c78fe318ea30/src/parser/parser.ts#L536)
|
||||
[src/parser/parser.ts:537](https://github.com/LuanRT/YouTube.js/blob/af92984523f90200a18314b94478a2697c9deab0/src/parser/parser.ts#L537)
|
||||
|
||||
@@ -14,4 +14,4 @@
|
||||
|
||||
## Defined in
|
||||
|
||||
[src/parser/parser.ts:720](https://github.com/LuanRT/YouTube.js/blob/4ae0cc5c523a2080e68d6c0c1437c78fe318ea30/src/parser/parser.ts#L720)
|
||||
[src/parser/parser.ts:721](https://github.com/LuanRT/YouTube.js/blob/af92984523f90200a18314b94478a2697c9deab0/src/parser/parser.ts#L721)
|
||||
|
||||
@@ -14,4 +14,4 @@
|
||||
|
||||
## Defined in
|
||||
|
||||
[src/parser/parser.ts:741](https://github.com/LuanRT/YouTube.js/blob/4ae0cc5c523a2080e68d6c0c1437c78fe318ea30/src/parser/parser.ts#L741)
|
||||
[src/parser/parser.ts:742](https://github.com/LuanRT/YouTube.js/blob/af92984523f90200a18314b94478a2697c9deab0/src/parser/parser.ts#L742)
|
||||
|
||||
@@ -22,4 +22,4 @@ Raw data.
|
||||
|
||||
## Defined in
|
||||
|
||||
[src/parser/parser.ts:230](https://github.com/LuanRT/YouTube.js/blob/4ae0cc5c523a2080e68d6c0c1437c78fe318ea30/src/parser/parser.ts#L230)
|
||||
[src/parser/parser.ts:231](https://github.com/LuanRT/YouTube.js/blob/af92984523f90200a18314b94478a2697c9deab0/src/parser/parser.ts#L231)
|
||||
|
||||
@@ -14,4 +14,4 @@
|
||||
|
||||
## Defined in
|
||||
|
||||
[src/parser/parser.ts:195](https://github.com/LuanRT/YouTube.js/blob/4ae0cc5c523a2080e68d6c0c1437c78fe318ea30/src/parser/parser.ts#L195)
|
||||
[src/parser/parser.ts:196](https://github.com/LuanRT/YouTube.js/blob/af92984523f90200a18314b94478a2697c9deab0/src/parser/parser.ts#L196)
|
||||
|
||||
@@ -14,4 +14,4 @@
|
||||
|
||||
## Defined in
|
||||
|
||||
[src/parser/parser.ts:162](https://github.com/LuanRT/YouTube.js/blob/4ae0cc5c523a2080e68d6c0c1437c78fe318ea30/src/parser/parser.ts#L162)
|
||||
[src/parser/parser.ts:163](https://github.com/LuanRT/YouTube.js/blob/af92984523f90200a18314b94478a2697c9deab0/src/parser/parser.ts#L163)
|
||||
|
||||
@@ -14,4 +14,4 @@
|
||||
|
||||
## Defined in
|
||||
|
||||
[src/parser/parser.ts:191](https://github.com/LuanRT/YouTube.js/blob/4ae0cc5c523a2080e68d6c0c1437c78fe318ea30/src/parser/parser.ts#L191)
|
||||
[src/parser/parser.ts:192](https://github.com/LuanRT/YouTube.js/blob/af92984523f90200a18314b94478a2697c9deab0/src/parser/parser.ts#L192)
|
||||
|
||||
@@ -12,4 +12,4 @@
|
||||
|
||||
## Defined in
|
||||
|
||||
[src/parser/parser.ts:47](https://github.com/LuanRT/YouTube.js/blob/4ae0cc5c523a2080e68d6c0c1437c78fe318ea30/src/parser/parser.ts#L47)
|
||||
[src/parser/parser.ts:48](https://github.com/LuanRT/YouTube.js/blob/af92984523f90200a18314b94478a2697c9deab0/src/parser/parser.ts#L48)
|
||||
|
||||
@@ -14,4 +14,4 @@
|
||||
|
||||
## Defined in
|
||||
|
||||
[src/parser/parser.ts:74](https://github.com/LuanRT/YouTube.js/blob/4ae0cc5c523a2080e68d6c0c1437c78fe318ea30/src/parser/parser.ts#L74)
|
||||
[src/parser/parser.ts:75](https://github.com/LuanRT/YouTube.js/blob/af92984523f90200a18314b94478a2697c9deab0/src/parser/parser.ts#L75)
|
||||
|
||||
Reference in New Issue
Block a user