-
-
Notifications
You must be signed in to change notification settings - Fork 232
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor!: replace unnecessary classes with pure functions (#468)
* deps: update linkedom * refactor!: remove YTNodeGenerator in favour of namespaced pure functions BREAKING CHANGES: - Removes `YTNodeGenerator` from `import('youtubei.js').Generator` and exposes its functions directly in `import('youtubei.js').Generator` * refactor!: replace Parser class with pure functions - Remove Parser class in favour of pure functions - Merge duplicate classes `AppendContinuationItemsAction` into a single class - Move continuation parsers into a seperate file - Add better custom logging support to parser methods as per issue #460 * refactor!: replace Proto class with pure functions * chore: update package-lock.json * refactor!: replace FormatUtils with pure functions and JSX components - Replace linkedom DASH manifest generation with a dependency free JSX implementation - Remove FormatUtils class in favour of pure functions - Remove DOMParser requirement - Remove duplicate types * refactor: implement changes from #462 * chore: lint * fix: deno support * fix: render valid xml document * fix: wrong function call in DashUtils * fix: typo in parser Co-authored-by: LuanRT <[email protected]> * refactor!: move streaming info logic into seperate function This allows users to access the same data available in the dash manifest while also simplifying the manifest generation * chore: lint * refactor: readability improvements & fixes Remove redundant getAudioTrackGroups General readability improvements in StreamingInfo.ts Share response object between `getBitrate` and `getMimeType` as to not make duplicate requests * build: remove unnecessary step in deno build Co-authored-by: absidue <[email protected]> * refactor: move types to `types` directory * docs: add back comments lost during refactor * chore: lint --------- Co-authored-by: LuanRT <[email protected]> Co-authored-by: absidue <[email protected]>
- Loading branch information
1 parent
eb3cca1
commit 87ed396
Showing
41 changed files
with
3,061 additions
and
7,373 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export * from './deno/src/platform/deno.ts'; | ||
import Innertube from './deno/src/platform/deno.ts'; | ||
export default Innertube; | ||
export default Innertube; |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
import Parser from '../../index.js'; | ||
import type { RawNode } from '../../index.js'; | ||
import { type SuperParsedResult, YTNode } from '../../helpers.js'; | ||
import type { ObservedArray } from '../../helpers.js'; | ||
import { YTNode } from '../../helpers.js'; | ||
|
||
export default class AppendContinuationItemsAction extends YTNode { | ||
static type = 'AppendContinuationItemsAction'; | ||
|
||
items: SuperParsedResult<YTNode>; | ||
contents: ObservedArray<YTNode> | null; | ||
target: string; | ||
|
||
constructor(data: RawNode) { | ||
super(); | ||
this.items = Parser.parse(data.continuationItems); | ||
this.contents = Parser.parseArray(data.continuationItems); | ||
this.target = data.target; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.