generated from fahricansecer/boilerplate-be
@@ -0,0 +1,20 @@
|
||||
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);
|
||||
Reference in New Issue
Block a user