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

21 lines
747 B
JavaScript

const { Innertube } = require('youtubei.js');
const util = require('util');
async function test() {
const youtube = await Innertube.create({ lang: 'tr', location: 'TR' });
const videoId = 'ix8cLltPCCE';
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('comment keys:', Object.keys(thread.comment));
console.log('comment reply_count:', thread.comment.reply_count);
console.log('comment like_count:', thread.comment.like_count);
console.log('comment content text:', thread.comment.content?.text);
}
}
}
test().catch(console.error);