Files
Harun CAN a40619ef33
Backend Deploy 🚀 / build-and-deploy (push) Has been cancelled
main
2026-05-06 10:48:07 +02:00

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);