generated from fahricansecer/boilerplate-be
27 lines
861 B
JavaScript
27 lines
861 B
JavaScript
const { Innertube } = require('youtubei.js');
|
|
|
|
async function test() {
|
|
const youtube = await Innertube.create({ lang: 'tr', location: 'TR' });
|
|
const videoId = 'ix8cLltPCCE';
|
|
console.log('Fetching comments for', videoId);
|
|
const commentThread = await youtube.getComments(videoId);
|
|
|
|
if (commentThread.contents && commentThread.contents.length > 0) {
|
|
const thread = commentThread.contents.find(t => t.has_replies);
|
|
if (thread) {
|
|
console.log('Thread keys:', Object.keys(thread));
|
|
console.log('Has replies:', thread.has_replies);
|
|
|
|
try {
|
|
const replies = await thread.getReplies();
|
|
console.log('Replies type:', typeof replies);
|
|
console.log('Replies object keys:', Object.keys(replies));
|
|
} catch (e) {
|
|
console.error('Error:', e.message);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
test().catch(console.error);
|