-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtest_youtubei.js
More file actions
32 lines (28 loc) · 1.18 KB
/
Copy pathtest_youtubei.js
File metadata and controls
32 lines (28 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const { Innertube } = require('youtubei.js');
(async () => {
try {
const youtube = await Innertube.create();
console.log('--- Searching Generic ---');
const search = await youtube.music.search('Thriller');
if (search.contents) {
console.log('Contents is array:', Array.isArray(search.contents));
const firstContent = search.contents[0];
console.log('First content type:', firstContent.type);
console.log('First content keys:', Object.keys(firstContent));
// Try to find where the actual items are
// Usually in a Shelf or ItemSection
if (firstContent.contents) {
console.log('First content contents length:', firstContent.contents.length);
console.log('First item in first content:', firstContent.contents[0].type);
}
}
console.log('Search results type:', typeof search.results);
if (search.results) {
console.log('Results found:', search.results.length);
} else {
console.log('No results property');
}
} catch (error) {
console.error('Error:', error);
}
})();