* feat(Session): Add `retrieve_innertube_config` option
This makes a call to `/config` to fetch hot/cold hash data, as well as config needed for certain requests and encryption (useful for "onesie" requests.)
Note: This is enabled by default. If you don't have any cache configured, the additional request will make session creation slightly slower!
* chore: Update config headers
* feat(utils): Implement LZW compression module
* feat(Session): Implement cache for sessions
This should improve performance quite a bit for those who are not using the `generate_session_locally` option (like me :P).
* refactor(Player): Add LZW compression
This considerably reduces the size of the cache.
This is a rewrite of the OAuth2 module to address some bugs and inconsistencies. And since it changes the structure of the credentials, I'm marking this as a breaking change.
Note that you will have to update your existing credentials, that is if you wish to continue using them. Otherwise, simply delete them and sign in again.
* chore: Update Android client version and UA
* refactor: Update shorts parameter protobuf
* chore: Update auto generated files
* chore: Add test
* chore: Update comments test id (unrelated)
* chore: Update comments test again (unrelated)
* feat(Session): Add fallback for session data retrieval
Should have added this when we first implemented session data retrieval to be honest. It makes a request to YouTube's service worker and the data there can change or the request can just fail.
* chore: lint
* 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 <luan.lrt4@gmail.com>
* 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 <48293849+absidue@users.noreply.github.com>
* refactor: move types to `types` directory
* docs: add back comments lost during refactor
* chore: lint
---------
Co-authored-by: LuanRT <luan.lrt4@gmail.com>
Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>
* fix(web): slow downloads due to visitor data
It seems that YouTube will throttle clients if a shared visitor id is used.
* dev: include `params` for `/player` reqs
* feat(Player.ts): append `cver` to deciphered URLs
* refactor(Actions.ts): remove redundant `getVideoInfo` function
This is leftover code from previous versions. It had many problems and it is no longer required.
* fix(Kids.ts): remove unneeded `await` keywords
* dev: add more endpoints
* chore: update deps
* refactor: separate endpoints into files
* dev: improve types
* dev: add more endpoints
* refactor: put clients in a separate directory inside `core`
* chore: lint
* refactor: move mixins and managers to separate folders
* chore: fix tests
* dev: add `CreateVideoEndpoint`
* chore: clean up
* chore: lint
* chore: add some comments
* chore: remove unnecessary test
* dev: add `playlist/CreateEndpoint`
* dev: add `playlist/DeleteEndpoint`
* dev: add `browse/EditPlaylistEndpoint`
* fix(parser): add a few checks to avoid parsing errors
* refactor!: cleanup platform support
* chore: lint
* fix: web platform
* feat: provide UniversalCache
Provide UniversalCache as a wrapper around Platform.shim.Cache.
* fix: invalid import
* refactor: remove isolated-vm support
* fix: type info
* refactor: cleanup exports
* fix: mark jintr as external dependency
In the bundled CJS node build, mark jintr as external.
* chore: add additional exports
web exports provide a way to select web implementation manually without
relying on the bundler to select it correctly from the "exports" field
web points to src/platform/web.js
web.bundle points to bundle/browser.js
web.bundle.browser points to bundle/browser.min.js
agnostic exports provide users of the library to provide their own
platform implementation without first importing the default one.
agnostic points to src/platform/lib.ts
* fix: toDash on web
* revert: eval is synchronous
* fix: use serializeDOM in FormatUtils
* ci: automate releases with `release-please`
* chore: clean up workflow files
* ci: fix NPM publish action
---------
Co-authored-by: LuanRT <luan.lrt4@gmail.com>
* dev: add `WEB_KIDS` innertube client
* refactor: move DASH manifest stuff out of `VideoInfo`
This makes it easier to use these functions elsewhere.
* feat(ytkids): add `Kids#getInfo()` & `Kids#search()`
* feat: add `Innertube#kids.getHomeFeed()`
* docs: add YouTube Kids API ref
* docs: fix typo
* docs: fix yet another typo
* docs: update YouTube Music API ref
Unrelated but required to reflect changes made to the DASH manifest generation functions
* chore: lint
* chore: add tests
* feat: include `captions` in `VideoInfo`
* chore: fix tests