mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-18 20:12:12 +00:00
feat: add support for generating sessions locally (#277)
* feat: add visitor data proto * feat: add support for generating session data locally * chore: add test
This commit is contained in:
@@ -141,6 +141,11 @@ describe('YouTube.js Tests', () => {
|
||||
expect(nop_yt.session.player).toBeUndefined();
|
||||
});
|
||||
|
||||
it('should create a session from data generated locally', async () => {
|
||||
const loc_yt = await Innertube.create({ generate_session_locally: true, retrieve_player: false });
|
||||
expect(loc_yt.session.context).toBeDefined();
|
||||
});
|
||||
|
||||
it('should resolve a URL', async () => {
|
||||
const url = await yt.resolveURL('https://www.youtube.com/@linustechtips');
|
||||
expect(url.payload.browseId).toBe(CHANNELS[0].ID);
|
||||
|
||||
Reference in New Issue
Block a user