feat(Session): allow setting a custom visitor data token (#371)

* feat(Session): allow setting a custom visitor data token

* docs: update init options

* chore: lint
This commit is contained in:
LuanRT
2023-03-24 01:30:24 -03:00
committed by GitHub
parent cb8fafe94b
commit 13ebf0a039
5 changed files with 44 additions and 17 deletions

View File

@@ -233,7 +233,7 @@ describe('YouTube.js Tests', () => {
it('should retrieve the "Related" tab', async () => {
const info = await yt.music.getInfo(VIDEOS[1].ID);
const related = await info.getRelated();
expect((related as any).length).toBeGreaterThan(3);
expect((related as any).length).toBeGreaterThan(0);
});
it('should retrieve albums', async () => {
@@ -278,9 +278,6 @@ describe('YouTube.js Tests', () => {
});
async function download(id: string, yt: Innertube): Promise<boolean> {
// TODO: add back info
// let got_video_info = false;
const stream = await yt.download(id, { type: 'video+audio' });
const file = fs.createWriteStream(`./${id}.mp4`);
@@ -288,5 +285,5 @@ async function download(id: string, yt: Innertube): Promise<boolean> {
file.write(chunk);
}
return fs.existsSync(`./${id}.mp4`); // && got_video_info;
return fs.existsSync(`./${id}.mp4`);
}